npm error : cb() never called, what should I do?

npm error : cb() never called, what should I do?

大家好。

我每次尝试安装 pacakges 时都会收到来自 npm 的错误。 我收到此错误:

npm ERR! cb() never called!

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

我知道已经有一个关于我的问题的话题,但我确实尝试了我能找到的所有解决方案,但没有一个有效。我多次卸载并重新安装节点,清理了我的缓存,但我无能为力!

这是我的 package.json

{
  "name": "XXXXXXXXXXX",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.21.0",
    "discord.js": "^12.4.0",
    "howlongtobeat": "^1.2.1",
    "npm": "^6.14.8"
  },
  "devDependencies": {}
}

谁能帮帮我,我不知道该怎么办,我无法安装单个包...

谢谢!

好的,我通过禁用防病毒软件设法解决了我的问题,我不知道为什么...

在花费数小时提出许多无效的建议之后。通过执行以下操作,我终于得到了 npx create-react-app 运行:

  1. 在命令提示符处通过 运行 以下代码卸载 npm:

    npm uninstall -g create-react-app
    
  2. 将超时增加 changing/adding 您 .npmrc 文件中的这一行:

    timeout=60000;
    prefer-offline=true;
    

    您的 .npmrc 文件可以在 C:\Program Files\nodejs\node_modules\npm (windows)

    中找到

    然后重启你的电脑

  3. 禁用您的防病毒软件(如 @Antoine 所说)

  4. 运行 命令提示符下的内容

    npm clean cache --force
    npm install create-react-app
    npx create-react-app my-app
    

    其中 my-app 是您的项目名称

注意:我没有使用任何代理。

就运行:

npm cache clean --force
npm cache verify
npm install --global npm

命令行是不言自明的。需要清除(清理)缓存并升级 npm。之后,它应该可以工作了。