pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

pm2 install gives WARN deprecated [email protected]: Please upgrade to version 7 or higher.

Open james-bw opened this issue 4 years ago • 22 comments

What's going wrong?

root@myhost:~# npm install pm2 -g
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 180 packages, and audited 181 packages in 6s

10 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
root@myhost:~# npm -v
7.20.2
root@myhost:~# node -v
v12.22.2

How could we reproduce this issue?

On new Ubuntu 20 linux install:

  1. Install Node 12
  2. Upgrade npm using npm install -g npm
  3. Install pm2 using npm install pm2 -g

Supporting information

$ pm2 report
--- PM2 report ----------------------------------------------------------------
Date                 : Thu Jul 29 2021 07:15:33 GMT+0000 (Coordinated Universal Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.1.0
node version         : 12.22.2
node path            : /usr/bin/pm2
argv                 : /usr/bin/node,/usr/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : root
uid                  : 0
gid                  : 0
uptime               : 0min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.1.0
node version         : 12.22.2
node path            : /usr/bin/pm2
argv                 : /usr/bin/node,/usr/bin/pm2,report
argv0                : node
user                 : root
uid                  : 0
gid                  : 0
===============================================================================
--- System info --------------------------------------------
arch                 : arm64
platform             : linux
type                 : Linux
cpus                 : unknown
cpus nb              : 2
freemem              : 2532102144
totalmem             : 4056465408
home                 : /root
===============================================================================
--- PM2 list -----------------------------------------------
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/root/.pm2/pm2.log last 20 lines:
PM2        | 2021-07-29T07:15:33: PM2 log: ===============================================================================
PM2        | 2021-07-29T07:15:33: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2        | 2021-07-29T07:15:33: PM2 log: Time                 : Thu Jul 29 2021 07:15:33 GMT+0000 (Coordinated Universal Time)
PM2        | 2021-07-29T07:15:33: PM2 log: PM2 version          : 5.1.0
PM2        | 2021-07-29T07:15:33: PM2 log: Node.js version      : 12.22.2
PM2        | 2021-07-29T07:15:33: PM2 log: Current arch         : arm64
PM2        | 2021-07-29T07:15:33: PM2 log: PM2 home             : /root/.pm2
PM2        | 2021-07-29T07:15:33: PM2 log: PM2 PID file         : /root/.pm2/pm2.pid
PM2        | 2021-07-29T07:15:33: PM2 log: RPC socket file      : /root/.pm2/rpc.sock
PM2        | 2021-07-29T07:15:33: PM2 log: BUS socket file      : /root/.pm2/pub.sock
PM2        | 2021-07-29T07:15:33: PM2 log: Application log path : /root/.pm2/logs
PM2        | 2021-07-29T07:15:33: PM2 log: Worker Interval      : 30000
PM2        | 2021-07-29T07:15:33: PM2 log: Process dump file    : /root/.pm2/dump.pm2
PM2        | 2021-07-29T07:15:33: PM2 log: Concurrent actions   : 2
PM2        | 2021-07-29T07:15:33: PM2 log: SIGTERM timeout      : 1600
PM2        | 2021-07-29T07:15:33: PM2 log: ===============================================================================

james-bw avatar Jul 29 '21 07:07 james-bw

same issue

dontbesatisfied avatar Aug 09 '21 15:08 dontbesatisfied

To solve this problem it is necessary to update some dependencies from pm2/io package | pm2/io repo. The dependencies that are giving the warning are probably these @opencensus/core & @opencensus/propagation-b3, just update to version 0.0.22 or 0.1.0 must work at least for production(final build), but that would break the build so it's not easy as change 2 digits.

The warning is really annoying tho

P.S. There are warnings in the dev dependencies too but I don't know if they will matter.

DavidProf avatar Sep 10 '21 11:09 DavidProf

This library uses too many old dependencies. Is no one maintaining it anymore?

flysnoworg avatar Nov 08 '21 01:11 flysnoworg

Any updates on this? I have been trying to get rid of warnings in my app and pm2 is the only one left causing issues.

KevinNovak avatar Jan 10 '22 14:01 KevinNovak

@KevinNovak nop, I tried to update one time but I had some problems doing it, so I created a issue where the problem is, to ask for help but for now, there's no update.

I did this fork but I broke a lot of things and I still don't have the time to see it.

If that's too annoying you could try to fix and open a PR, but I'm not sure if they will approve (are they active?).

Edit:

Actually, there is a pull request regarding this

https://github.com/keymetrics/pm2-io-apm/pull/287

But it was not approved yet because it has conflicts

DavidProf avatar Jan 11 '22 18:01 DavidProf

any update ?

thecertifiednoob avatar Mar 17 '22 08:03 thecertifiednoob

any update ?

@thecertifiednoob

There is an issue for the problem:

  • https://github.com/keymetrics/pm2-io-apm/issues/285

Not that someone really cares to fix it. Like me btw, that just gave in because I didn't want to use it anymore (doesn't have a use for my use case nowadays). And it is just a warning, not really that important for this project in specific, just annoying.

DavidProf avatar Mar 18 '22 13:03 DavidProf

+1 here when is solved?

cesarjorgemartinez avatar Jul 15 '22 12:07 cesarjorgemartinez

Using node 16:

npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

cesarjorgemartinez avatar Jul 19 '22 09:07 cesarjorgemartinez

@Unitech Could you please leave some information here? This 3-year old deprecated module should be updated imo.

sephentos avatar Jul 29 '22 09:07 sephentos

Same here. Hope to hear your expertise on the issue.

robbiedood avatar Sep 01 '22 20:09 robbiedood

@Unitech Any update on this issue? It's too outdated. Hope to hear from you guy soon

longpt99 avatar Sep 09 '22 03:09 longpt99

warning pm2 > @pm2/io > @opencensus/propagation-b3 > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. warning pm2 > @pm2/io > @opencensus/core > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. warning pm2 > @pm2/io > @opencensus/propagation-b3 > @opencensus/core > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. [2/4] 🚚 Fetching packages... error [email protected]: The engine "node" is incompatible with this module. Expected version ">=12.22.0 <=16.x.x". Got "18.12.1" error Found incompatible module. info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

xpcovertech avatar Dec 17 '22 15:12 xpcovertech

npm install -g @soketi/soketi
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
soketi start
/usr/lib/node_modules/@soketi/soketi/node_modules/uWebSockets.js/uws.js:22
                throw new Error('This version of uWS.js supports only Node.js 14, 16 and 18 on (glibc) Linux, macOS and Windows, on Tier 1 platforms (https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list).\n\n' + e.toString());
                ^

Error: This version of uWS.js supports only Node.js 14, 16 and 18 on (glibc) Linux, macOS and Windows, on Tier 1 platforms (https://github.com/nodejs/node/blob/master/BUILDING.md#platform-list).

Error: Cannot find module './uws_linux_x64_111.node'
Require stack:
- /usr/lib/node_modules/@soketi/soketi/node_modules/uWebSockets.js/uws.js
- /usr/lib/node_modules/@soketi/soketi/dist/server.js
- /usr/lib/node_modules/@soketi/soketi/dist/index.js
- /usr/lib/node_modules/@soketi/soketi/dist/cli/cli.js
- /usr/lib/node_modules/@soketi/soketi/dist/cli/index.js
- /usr/lib/node_modules/@soketi/soketi/bin/server.js
    at /usr/lib/node_modules/@soketi/soketi/node_modules/uWebSockets.js/uws.js:22:9
    at Object.<anonymous> (/usr/lib/node_modules/@soketi/soketi/node_modules/uWebSockets.js/uws.js:24:3)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/usr/lib/node_modules/@soketi/soketi/dist/server.js:18:13)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)

Node.js v19.3.0

victorbondaruk avatar Dec 27 '22 18:12 victorbondaruk

Could we get an update on this? I've been having this issue for over a year now. Is there some breaking change preventing package upgrades? Or is it just the risk involved? I wouldn't mind testing a pre-release version if it helped to address this.

KevinNovak avatar Dec 27 '22 18:12 KevinNovak

I downloaded the version of node 8.19.2 npm -v 8.19.2 `npm install -g @soketi/soketi npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.

changed 348 packages, and audited 349 packages in 1m

29 packages are looking for funding run npm fund for details

1 high severity vulnerability

Some issues need review, and may require choosing a different dependency.

Run npm audit for details. npm audit npm ERR! code ENOLOCK npm ERR! audit This command requires an existing lockfile. npm ERR! audit Try creating one first with: npm i --package-lock-only npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-12-27T18_58_34_193Z-debug-0.log soketi start

🕵️‍♂️ Initiating metrics endpoints...

🎉 Server is up and running!
📡 The Websockets server is available at 127.0.0.1:6001
🔗 The HTTP API server is available at http://127.0.0.1:6001
🎊 The /usage endpoint is available on port 9601. `

And run. But it would be interesting to update Soketi. Happy New Year!

victorbondaruk avatar Dec 27 '22 19:12 victorbondaruk

not sure if useful, but was able to work around this by doing: npm install pm2@latest -g

ultrafro avatar Feb 09 '23 03:02 ultrafro

Now opencensus itself is EOL. It's been subsumed by openTelemetry, apparently.

JJ avatar May 04 '23 06:05 JJ

I resolved this Problem already now! I tried for this problem.

  1. Delete file .zshrc
  2. I made .zshrc using nano
  3. I copied already .zshrc contents and pasted editing nano .zshrc
  4. again update npm i -g npm or used source .zshrc
  5. You can typing pm2 in terminal or whereis pm2
  6. You can checking pm2 : path-way

This's just my solution. I hope it helps for this problem.

devchaeyoung avatar Aug 20 '23 08:08 devchaeyoung

not sure if useful, but was able to work around this by doing: npm install pm2@latest -g

This does not work

runev-admin avatar Nov 25 '23 03:11 runev-admin

@Unitech there is no way this hasn't been resolved almost 2.5 years later?

~ $ node --version
v21.5.0
~ $ npm --version
8.6.0
~ $ # latest node and npm versions
~ $ npm install pm2@latest -g
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  
Older versions may use Math.random() in certain circumstances, which is known to be problematic.  
See https://v8.dev/blog/math-random for details.

added 158 packages, and audited 159 packages in 14s

13 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Chiroyce1 avatar Jan 26 '24 13:01 Chiroyce1

Испробовал несколько способов. Обновил uuid до последнего, почистил кэш(npm clean cash), затем с сайта: https://pm2.io/docs/runtime/guide/installation/ взял команду: npm install pm2 -g && pm2 update У меня запустилось и заработало. Попробуйте! Может кому-то тоже поможет

ksimaster avatar May 06 '24 07:05 ksimaster