【发布时间】:2019-04-29 14:54:19
【问题描述】:
无法在 mac 中运行 npm,尝试卸载重新安装它。 (正确移除 NPM 并重新安装)。但每次我都低于错误。
Error: EEXIST: file already exists, mkdir '/usr/local/bin/npm'
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:196:13)
at process._fatalException (internal/process/execution.js:146:25)
当我输入 NPM 时,它应该运行,但我遇到了错误。
【问题讨论】:
-
NPM 文件的权限是:``` lrwxr-xr-x 1 root admin 38 Apr 29 09:36 npm -> ../lib/node_modules/npm/bin/npm-cli。 js```
标签: npm