【问题标题】:I am trying to install node locally following error occurs. I tried reinstalling node several times but still it shows error我正在尝试在发生错误后在本地安装节点。我尝试了几次重新安装节点,但仍然显示错误
【发布时间】:2020-12-18 04:51:26
【问题描述】:

我在尝试安装节点时收到此错误

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!     C:\Users\lenovo\AppData\Roaming\npm-cache\_logs\2020-08-29T13_30_35_085Z-debug.log

【问题讨论】:

  • 你能发布你用来安装节点的命令吗?
  • 日志文件中有什么内容?您处于节点安装过程的哪个阶段?我很困惑:您是按照您的说法安装节点,还是在运行 npm 或 create-react-app 或 ...?
  • 这能回答你的问题吗? npm ERR cb() never called

标签: node.js reactjs npm node-modules create-react-app


【解决方案1】:
  1. 在安装节点之前先试试这个。

     sudo npm cache verify
    
     sudo npm cache clean --force
    
  2. 安装后验证您的安装:

    节点--版本

【讨论】:

    【解决方案2】:

    您可以尝试以下几种方法

    sudo npm cache clean --force
    

    尝试更改 npm 的所有权并尝试 npm latest

    sudo chown -R $(whoami) ~/.npm
    sudo chown -R $(whoami) /usr/local/lib
    sudo chown -R $(whoami) /usr/local/bin
    npm install -g npm@latest
    

    通过清除代理尝试一下,也许你在代理后面

    npm config set proxy null
    npm config set https-proxy null
    npm config set registry http://registry.npmjs.org/
    

    最近我想推荐你使用 NVM 包。它不是您直接回答的解决方案,而是管理和拥有不同节点/npm 环境的好方法 https://davidwalsh.name/nvm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-09
      • 2016-08-25
      • 1970-01-01
      • 2023-03-08
      • 2015-04-09
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      相关资源
      最近更新 更多