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

在CentOS7环境下,使用npmv9.5.1安装pm2时遇到uuidv3.4.0的弃用警告。通过更新uuid到最新版本,然后找到pm2的安装路径并创建软链接,最终成功安装并验证了pm2的版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、问题

环境

系统:centos 7
node :v18.16.1
npm:9.5.1

安装pm2

npm install -g pm2

提示报错:

npm WARN deprecated uuid@3.4.0: 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

二、解决

更新uuid

npm install uuid@latest -g

更新成功后,继续安装pm2,也会提示:npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher.

其实是已经安装成功了

1、查找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、增加pm2软链接

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

查看pm2版本

pm2 -v
即可

在这里插入图片描述

npm warn deprecated @types/minimatch@6.0.0: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed. npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported npm warn deprecated consolidate@0.15.1: Please upgrade to consolidate v1.0.0+ as it has been modernized with several long-awaited fixes implemented. Maintenance is supported by Forward Email at https://forwardemail.net ; follow/watch https://github.com/ladjs/consolidate for updates and release changelog npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead npm warn deprecated dommatrix@1.0.3: dommatrix is no longer maintained. Please use @thednp/dommatrix. npm warn deprecated uuid@3.4.0: 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 webpack-ch
最新发布
07-10
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值