简体   繁体   English

无法使用 create-react-app 创建新的 React 项目

[英]cannot create a new react project using create-react-app

I am trying to create a new react project with create-react-app but each time it fails because of this error.......我正在尝试使用 create-react-app 创建一个新的 React 项目,但每次都因为这个错误而失败......

I am using npm version 6.3.0 and node version 10.8.0我使用的是npm版本6.3.0node版本10.8.0

I don't know what to do............我不知道该怎么办............

Creating a new React app in C:\\Users\\Demonblade\\Desktop\\test .C:\\Users\\Demonblade\\Desktop\\test创建一个新的 React 应用程序。

Installing packages.安装软件包。 This might take a couple of minutes.这可能需要几分钟时间。 Installing react, react-dom, and react-scripts...安装 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.

Use npx (it comes with npm 5.2+).使用npx (它与npm 5.2+)。

From the react docs :反应文档

You'll need to have Node >= 6 and npm >= 5.2 on your machine.您需要在您的机器上安装 Node >= 6 和 npm >= 5.2。 To create a project, run:要创建项目,请运行:

npx create-react-app my-app
cd my-app
npm start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM