【问题标题】:Im getting this error everytime time I want to create a react app:每次我想创建一个反应应用程序时都会收到这个错误:
【发布时间】:2021-08-29 01:40:43
【问题描述】:

命令行错误:

npm ERR! cb() never called!

我运行了命令:

npx create-react-app test

我也尝试运行 clean cache 命令,但仍然出现同样的错误。

【问题讨论】:

  • 你使用什么节点版本?这可能是因为您使用的是节点 4 或 6。运行node -v 来查看。如果开始一个新项目,最好使用节点 14。
  • 兄弟我昨天重新安装了node.js。它是最新版本,即 v14.17.0

标签: node.js reactjs npm npx


【解决方案1】:

您是否尝试过使用 --force 选项?

sudo npm cache clean --force

更多信息请参考:https://reactgo.com/npm-err-cb-never-called/

【讨论】:

  • 我使用的是windows操作系统。
  • create-react-app 在全局范围内不起作用 npm uninstall -g create-react-app npm install create-react-app create-react-app test
  • 我将它全局卸载并使用npm i create-react-app 重新安装。它仍然无法正常工作
猜你喜欢
  • 2020-11-29
  • 2020-12-20
  • 2021-08-26
  • 1970-01-01
  • 1970-01-01
  • 2022-10-04
  • 2021-03-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多