npm install问题:目录上的非法操作

时间:2018-12-24 01:37:17

标签: node.js npm

我正在尝试升级npm:

npm install -g npm

但是我多次收到类似的警告:

warn tar EISDIR: illegal operation on a directory, open '/tmp/npm-4154-cadf3470/unpack-87786b4c/bin/node-gyp-bin'

我的堆栈跟踪以错误结尾,该错误指示找不到文件:

npm ERR! path /private/tmp/npm-4154-cadf3470/unpack-87786b4c/node_modules/run-queue/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/private/tmp/npm-4154-cadf3470/unpack-87786b4c/node_modules/run-queue/package.json'
npm ERR! enoent This is related to npm not being able to find a file.

还有其他人有类似的问题吗?

1 个答案:

答案 0 :(得分:2)

必须uninstall node completely,然后使用brew重新安装:

brew install node