gpt4 book ai didi

node.js - 将 npm 从 2.10.1 升级到 3.5.2 后,为什么 `npm update -g` 和 `npm outdated` 不工作?

转载 作者:搜寻专家 更新时间:2023-11-01 00:17:32 25 4
gpt4 key购买 nike

将 npm 从 2.10.1 更新到 3.5.2 后,我现在遇到两个类似的错误。

npm 已通过运行 npm update -g

更新

我在 OSX 10.10.5 上运行 Node v0.12.4,通过自制软件安装

两条错误信息

1 这是我现在通过运行 npm outdated -g --depth=0 得到的错误:

npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "outdated" "-g" "--depth=0"
npm ERR! node v0.12.4
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at module.exports (/usr/local/lib/node_modules/npm/lib/install/mutate-into-logical-tree.js:12:3)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/outdated.js:78:5
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/outdated.js:62:20
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:186:9
npm ERR! typeerror at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:17:25)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:152:20
npm ERR! typeerror at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:17:25)
npm ERR! typeerror at then (/usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:121:22)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:81:20
npm ERR! typeerror at fs.js:1518:23
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/brianzelip/npm-debug.log

2 这是我现在通过运行 npm update -g 得到的错误消息:

npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "update" "-g"
npm ERR! node v0.12.4
npm ERR! npm v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror at module.exports (/usr/local/lib/node_modules/npm/lib/install/mutate-into-logical-tree.js:12:3)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/outdated.js:78:5
npm ERR! typeerror at /usr/local/lib/node_modules/npm/lib/outdated.js:62:20
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:186:9
npm ERR! typeerror at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:17:25)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:152:20
npm ERR! typeerror at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:17:25)
npm ERR! typeerror at then (/usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:121:22)
npm ERR! typeerror at /usr/local/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:81:20
npm ERR! typeerror at fs.js:1518:23
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR! /Users/brianzelip/npm-debug.log

最佳答案

在我的例子中,这是因为有一个全局包符号链接(symbolic link),其目标已被删除。

关于node.js - 将 npm 从 2.10.1 升级到 3.5.2 后,为什么 `npm update -g` 和 `npm outdated` 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34384611/

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