简体   繁体   English

我正在尝试下载React js,但是又一次又一次出现此错误?

[英]I am trying to download React js, but I am getting this error again and again?

I am downloading react js with npm , but I am getting this error again and again. 我正在使用npm下载react js,但是一次又一次出现此错误。 Can any give me solution.I have tried multiple times but it is still giving me same error. 任何可以给我解决方案。我已经尝试了多次,但仍然给我同样的错误。

C:\\react\\todo>npm start C:\\ react \\ todo> npm开始

> todo@0.1.0 start C:\react\todo
> react-scripts start
Starting the development server...

events.js:180
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn cmd',
  path: 'cmd',
  spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todo@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todo@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HAROON & ABDULREHMAN\AppData\Roaming\npm-cache\_logs\2019-08-28T21_27_54_711Z-debug.log

After some research, I found this. 经过研究,我发现了这一点。

I(tylerlaberge) ran into this exact issue as well and found that it is only present with react-scripts@3.0.0, downgrading to react-scripts@2.1.8 resolved the issue without needing to mess with environment variables. 我(tylerlaberge)也遇到了这个确切的问题,发现它仅在react-scripts@3.0.0中存在,降级到react-scripts@2.1.8解决了该问题,而无需弄乱环境变量。

create-react-app my-app
cd my-app
npm install react-scripts@2.1.8
npm start

https://github.com/facebook/create-react-app/issues/6985#issuecomment-490319841 https://github.com/facebook/create-react-app/issues/6985#issuecomment-490319841

You should use npx create-react-app appname this is from react docs https://reactjs.org/docs/create-a-new-react-app.html . 您应该使用npx create-react-app appname该名称来自react docs https://reactjs.org/docs/create-a-new-react-app.html I use to have a lot of problems when I used npm create-react-app , they all went away when I stated using npx. 当我使用npm create-react-app时,我经常遇到很多问题,当我说使用npx时,它们都消失了。

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

相关问题 当我使用反应钩子时,API 被一遍又一遍地调用 - API is getting called over and over again when I am using react hooks 我正在尝试通过单击使用 React.js 的按钮来更改图像,但出现错误 - I am trying to change image by clicking buttons using React.js but getting error 我正在尝试在反应中实现 menuitem 但出现错误 - I am trying to implement menuitem in react but getting error 我正在尝试在反应中添加添加搜索过滤器,但我收到此错误 - I am trying to add add Search filter in react but I am getting this error 一个简单的 JS 代码,我一遍又一遍地收到相同的结果,我想,我可能犯了一个逻辑错误, - A simple JS code and I am receiving the same result over and over again, I think, I may have done a logical error, 我正在尝试将值从数据库传递给 js。 但是我收到了一个步进错误? - I am trying to pass values from Database to js. But i am getting an error of stepup? React JS:为什么我在 componentdidMount() 中出错? - React JS: Why am I getting error at componentdidMount()? 我得到输入字符串的格式不正确,尽管我一遍又一遍地使用相同的格式 - I am getting Input string was not in a correct format although i used the same format over and over again 为什么我收到未定义的错误错误? - Why am I a getting an error that react is undefined? 为什么我收到这个JS错误? - Why am I getting this JS error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM