gpt4 book ai didi

node.js - 无法更新/安装最新的 npm 版本

转载 作者:行者123 更新时间:2023-12-04 18:49:15 28 4
gpt4 key购买 nike

如果我使用命令

apt npm install -g npm
或者
npm install -g npm@6.14.10
我仍然得到 npm@5.6.0 .这真的很奇怪。我还删除了所有内容并重新安装了它,但它没有用。
出现以下错误:
npm install -g npm

npm WARN npm npm does not support Node.js v14.15.3
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in:
npm ERR! /home/tom/.npm/_logs/2021-01-03T11_35_05_408Z-debug.log
npm version

npm WARN npm npm does not support Node.js v14.15.3
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
{
npm: '5.6.0',
ares: '1.16.1',
brotli: '1.0.9',
cldr: '37.0',
icu: '67.1',
llhttp: '2.1.3',
modules: '83',
napi: '7',
nghttp2: '1.41.0',
node: '14.15.3',
openssl: '1.1.1g',
tz: '2020a',
unicode: '13.0',
uv: '1.40.0',
v8: '8.4.371.19-node.17',
zlib: '1.2.11'
}
不知道我需要改变什么来解决我的问题。我非常感谢每一个帮助。
更新: (感谢@Mr.)
使用命令: npm upgrade -g npm --verbose
npm info it worked if it ends with ok
npm WARN npm npm does not support Node.js v14.15.3
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
npm verb cli [
npm verb cli '/usr/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'upgrade',
npm verb cli '-g',
npm verb cli 'npm',
npm verb cli '--verbose'
npm verb cli ]
npm info using npm@5.6.0
npm info using node@v14.15.3
npm verb npm-session 78951400057ee470
npm verb update computing outdated modules to update
npm verb stack TypeError: cb.apply is not a function
npm verb stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18
npm verb stack at FSReqCallback.oncomplete (fs.js:184:5)
npm verb cwd /home/tom
npm verb Linux 5.4.0-58-generic
npm verb argv "/usr/bin/node" "/usr/local/bin/npm" "upgrade" "-g" "npm" "--verbose"
npm verb node v14.15.3
npm verb npm v5.6.0
npm ERR! cb.apply is not a function
npm verb exit [ 1, true ]

最佳答案

我有一个类似的问题。所以this帮助过我。也许它也可以解决您的问题。
(信用转到@Trott)

关于node.js - 无法更新/安装最新的 npm 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65549404/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com