解决npm WARN deprecated [email protected]: Please upgrade to version 7 or higher

1. Problems

environment

System: centos 7
node: v18.16.1
npm: 9.5.1

install pm2

npm install -g pm2

Prompt error:

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.

changed 184 packages in 17s

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

Two, solve

update uuid

npm install uuid@latest -g

After the update is successful, continue to install pm2, and it will also prompt: npm WARN deprecated [email protected]: Please upgrade to version 7 or higher.

In fact, it has been successfully installed

1. Find the installation location of pm2

find / -name pm2

/usr/local/lib/node_modules/pm2
/usr/local/lib/node_modules/pm2/lib/templates/logrotate.d/pm2
/usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/lib/node_modules/pm2/pm2

2. Add pm2 soft link

ln -s /usr/local/lib/node_modules/pm2/bin/pm2 /usr/local/bin

View pm2 version

pm2 -v
can

insert image description here

Guess you like

Origin blog.csdn.net/gusijin/article/details/131409178