【问题标题】:npm crashes with "ERR! cb() never called"npm 崩溃并显示“ERR!cb() never called”
【发布时间】:2019-12-10 19:20:44
【问题描述】:

我正在尝试使用

安装 vue-cli

npm install -g @vue/cli

我收到以下错误

Unhandled rejection Error: EACCES: permission denied, mkdir '/home/moeketsi/.npm/_cacache/tmp'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!  /home/moeketsi/.npm/_logs/2019-08-02T07_16_39_683Z-debug.log

日志文件为available here

当我尝试使用sudo 运行命令时,我得到了

sudo: npm: command not found

我正在使用节点 v10.16.1 和 npm vesrsion 是 6.9.0 。我从他们的website 安装了 node.js。我从postslightly different case 尝试了以下建议,但没有任何建议有帮助。

【问题讨论】:

    标签: node.js npm vue-cli


    【解决方案1】:

    根据documentation,如果您安装了以前的版本,您可能会遇到问题。你可以查看所有使用npm list -g安装的包。

    要卸载以前版本的 vue-cli,请使用 npm uninstall vue-cli -g

    如果不是这种情况,您可以尝试运行npm cache clear --force 并尝试重新安装。

    【讨论】:

      【解决方案2】:

      这是权限问题。转到根目录并尝试安装。

      从root用户尝试:

      sudo -i
      
      npm install -g @vue/cli
      

      如果你想维护当前目录。

      sudo -s
      
      npm install -g @vue/cli
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-05-30
        • 2019-04-11
        • 2013-03-01
        • 2018-09-19
        • 2020-06-15
        • 2021-03-03
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多