搜索
您的当前位置:首页正文

npm安装升级报错!

来源:榕意旅游网

使用命令:npm install -g npm,报错如下

E:\vue>npm install -g npm
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@10.2.5
npm ERR! notsup Not compatible with your version of node/npm: npm@10.2.5
npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}
npm ERR! notsup Actual:   {"npm":"9.6.4","node":"v20.0.0"}

npm ERR! A complete log of this run can be found in: C:\Users\DELL\AppData\Local\npm-cache\_logs\2024-01-09T02_10_29_038Z-debug-0.log

改用如下命令:npm install --force -g npm

E:\vue>npm install --force -g npm
npm WARN using --force Recommended protections disabled.
npm WARN install Forcing global npm install with incompatible version 10.2.5 into node v20.0.0

removed 43 packages, and changed 90 packages in 3s

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

查看一下版本:原来版本是9.6.4,现在版本是10.2.5

E:\vue>npm -v
npm WARN cli npm v10.2.5 does not support Node.js v20.0.0. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
10.2.5

但是和当前的node版本不兼容,升级一下node

因篇幅问题不能全部显示,请点此查看更多更全内容

Top