reactjs - 无法使用 create-react-app 创建新的反应项目
问题描述
我正在尝试使用 create-react-app 创建一个新的反应项目,但每次它都因为这个错误而失败......
我正在使用npm
版本6.3.0
和node
版本10.8.0
我不知道该怎么办............
在C:\Users\Demonblade\Desktop\test
.
安装软件包。这可能需要几分钟。安装 react、react-dom 和 react-scripts...
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\Demonblade\AppData\Roaming\npm-cache\_logs\2018-08-09T15_27_48_357Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting test / from C:\Users\Demonblade\Desktop
Done.
解决方案
使用npx
(它带有npm
5.2+)。
从反应文档:
您需要在您的机器上安装 Node >= 6 和 npm >= 5.2。要创建项目,请运行:
npx create-react-app my-app
cd my-app
npm start
推荐阅读
- sql - SELECT 中的 SQL WHERE 语句?
- java - 在 GraphQL-java 中为 GraphQL 枚举返回不同的值
- arrays - 我的 3D 数组长度为 2,但在运行时访问索引 2 恐慌
- javascript - 如何在同一个 Contao 页面上获取 jQuery 和 Mootools?
- firebase - 访问另一个项目中的 firebase 函数环境变量
- memory-management - 系统中的字大小和存储单元大小
- java - 如何比较并行数组中的值以消除重复项?
- java - 如何管理 Tomcat 的 reloadable="true" 设置的 CPU 使用率?
- r - R中特定数量数据点的功能
- mysql - MySQL:仅当指定买家选择了项目时才查找项目的最大出价数