'Npm start' fails on react-scripts-start
See original GitHub issueI have 4 projects bootstrapped using create-react-app. One of the projects is working completely fine. However, with the other three, upon using “npm start”, the app is crashing. The complete error message and debug output have been shared:
Error message:
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.utput above.
Debug output:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\ayush\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'start' ]
2 info using npm@6.14.8
3 info using node@v10.15.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle client@0.1.0~prestart: client@0.1.0
6 info lifecycle client@0.1.0~start: client@0.1.0
7 verbose lifecycle client@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle client@0.1.0~start: PATH: C:\Users\ayush\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Courses\WebDevelopment\Projects\Github\client\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\ayush\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\nodejs;C:\Program Files\Java\jdk-12.0.2\bin;C:\Users\ayush\AppData\Local\Programs\Python\Python37\Scripts;C:\Users\ayush\AppData\Local\Programs\Python\Python37;C:\Users\ayush\AppData\Local\Microsoft\WindowsApps;C:\Users\ayush\AppData\Local\GitHubDesktop\bin;C:\Users\ayush\AppData\Roaming\npm;C:\Program Files\heroku\bin;C:\Program Files\MongoDB\Server\4.0\bin;C:\Users\ayush\AppData\Local\Tesseract-OCR;C:\Program Files\CodeBlocks\MinGW\bin
9 verbose lifecycle client@0.1.0~start: CWD: E:\Courses\WebDevelopment\Projects\Github\client
10 silly lifecycle client@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle client@0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle client@0.1.0~start: Failed to exec start script
13 verbose stack Error: client@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\ayush\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:189:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\ayush\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:189:13)
13 verbose stack at maybeClose (internal/child_process.js:970:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid client@0.1.0
15 verbose cwd E:\Courses\WebDevelopment\Projects\Github\client
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ayush\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.1
19 verbose npm v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error client@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the client@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Methods tried to fix the issue:
-
I removed the package.json file and node_modules directory, and ran npm install.
-
I reinstalled node and npm.
-
I reinstalled create-react-app and react-scripts-start
Additional information: Node version: v10.15.1 Npm version: 6.14.8 React script: ‘react-scripts@3.4.0’
Issue Analytics
- State:
- Created 3 years ago
- Comments:17
Top Results From Across the Web
javascript - npm start error with create-react-app - Stack Overflow
Go to your C:\Users\<USER>\AppData\Roaming · Delete npm and npm-cache directories... · Go back to your application directory and remove ...
Read more >How to fix npm start not working error in React JS - YouTube
How to solve npm err code enoent error syscall open no such file or directory , npm start not working in react js...
Read more >[Solved] react-scripts: command not found - ItsJavaScript
If you are trying to run the react project using the npm start command on your terminal, you might have got an error...
Read more >Fix: React Scripts Command not Found Error - αlphαrithms
In the case where an app might have been cloned, the node_modules directory would not have been copied. As such, one needs to...
Read more >Asp.net Core 2.1 + ReactJS don't work - Visual Studio Feedback
npm ERR! npm ERR! Failed at the WebApplication1@0.1.0 start script 'rimraf ./build && react-scripts start'. npm ERR! This is most likely a problem...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @jamesg1, Thanks for the suggestions. You correctly pointed out the issue! I upgraded the node installation to the latest version (v14.9.0) and everything is working fine. The link you shared were also very helpful. Thank you 😃
@verma-anushka is it happening on windows OS? I had faced the same issue on my windows system.
I use the
react-scripts@3.4.1
and it works for me.Many a times
npx create-react-app project-name
does not work for me on Windows OS. So I have created a repository react-typescript-empty-project, which I clone and build app on top of it