node.js - npm 错误!cb() 在创建第一个反应项目时从未在 windows10 上调用过
问题描述
使用命令“create-react-app myfirstapp”创建第一个反应应用程序时,出现以下错误:
D:\ReactProject>create-react-app myfirstapp
Creating a new React app in D:\ReactProject\myfirstapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
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\intex\AppData\Roaming\npm-cache\_logs\2021-02-19T07_57_36_091Z-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
Deleting myfirstapp/ from D:\ReactProject
安装的 ReactJS 版本是:
D:\ReactProject>create-react-app --version
4.0.2
安装的节点版本是:
D:\ReactProject>node -v
v14.15.5
注意:这是我第一次在 Windows 机器上创建 ReactJS 应用程序,所以第一次在这台机器上安装了 NodeJS 并尝试创建反应应用程序并得到了上述错误。
请让我知道您对修复这些错误的建议。
解决方案
我刚刚在Windows 10上试过。我使用了 PowerShell 窗口。很简单,转到您的项目目录 -> 按住 shift 按钮并单击鼠标右键 -> 选择“在此处打开 PowerShell 窗口” -> 在该 cmd 中启动。这个对我有用。
推荐阅读
- numpy - numpy数组中的间距
- java - 如何设置 android studio 材质滑块的样式
- sql-server - Docker 容器应用程序中的 EF Core SQL 数据库连接错误
- apache-kafka - SpoolDir Kafka 连接器 - 错误处理程序中超出了容差
- typescript - 如果验证失败,如何设置后备值(NestJS,类验证器)
- bash - 将函数添加到 bash 脚本导致错误
- python - 为什么我无法从线程聊天中获取文本?
- javascript - 为传单路由机导入大量 JSON 坐标
- python - 如何为每个句子的字母获取字母索引?
- python - Pandas 将 Nan 分类为额外的 Max Bin