node.js - npm install : illegal operation on a directory 出现问题

标签 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.

还有人遇到类似的问题吗?

最佳答案

不得不uninstall node completely并使用brew重新安装:

brew install node

关于node.js - npm install : illegal operation on a directory 出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53908432/

相关文章:

node.js - 如何安装 NodeJs 旧版本(0.10.40)

typescript 在运行 npm start 后自动创建 js 文件

node.js - 无法在 react native 教程中启动 npm

node.js - 无法使用 Windows 10 安装 firebase 工具 cli

node.js - 尝试访问 DynamoDB 时 AWS Lambda node.js 超时

node.js - 如何从 Node 应用程序打开 ec2 上的 http 流量端口?

node.js - 在 Node 上安装 bcrypt 时出现 ELIFECYCLE 错误。 CXX 错误?

javascript - 运行两台服务器时 NodeJS 服务器错误

npm - 为什么 npm 从私有(private)注册表而不是从 registry.npmjs.org 安装包

angular - 无法在 'createObjectURL' : Overload resolution failed with npm file-saver 上执行 'URL'