【问题标题】:npm ERR! cb() never called! npm ERR! This is an error with npm itself. Please report this error at: npm ERRnpm 错误! cb() 从未调用过! npm 错误!这是 npm 本身的错误。请在以下位置报告此错误:npm ERR
【发布时间】:2021-05-12 16:34:25
【问题描述】:

    npm ERR! cb() never called!
    
    npm ERR! This is an error with npm itself. Please report this error at:
    npm ERR!     <https://github.com/npm/cli/issues>
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/abhijith/.npm/_logs/2021-05-12T16_20_42_200Z-debug.log
    
    Aborting installation.
      npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
    
    Deleting generated file... package.json

尝试安装 react { npx react-create-app app}

时出错

我尝试 sudo npm cache,sudo npm cache --force clean 但仍然出现同样的错误

【问题讨论】:

  • 确保您使用正确的节点版本来安装包
  • 是的,如果我删除节点全局并重新安装它,我会使用稳定版本,但有时会出现同样的错误!

标签: node.js reactjs npm


【解决方案1】:

这是一个与 npm 包相关的错误,安装最新版本的 npm 对我有用:

npm install -g npm@latest

【讨论】:

    【解决方案2】:

    安装最新版本的 npm 后,我的问题也得到了解决。但我需要在npm install -g npm@latest 之前使用sudo。否则会出现一些警告和拒绝访问的错误。

    【讨论】:

      猜你喜欢
      • 2018-09-19
      • 2021-06-02
      • 2020-06-15
      • 2020-06-24
      • 2018-03-20
      • 2019-12-18
      • 2020-02-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多