create-react-app: 'Npm start' fails on react-scripts-start

I 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’

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Most upvoted comments

Hi @verma-anushka I think you have an older node version which is the main issue. The docs says https://github.com/facebook/create-react-app#creating-an-app - You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine. Your using v10.15.1 which means it may not work. I would recommend updating to Node 12 (12.18.3 LTS) and it should work ok.

I use https://github.com/nvm-sh/nvm Node version manager to quickly change node versions.

Also for a clean install of node/js projects you should remove the package-lock.json and node_modules.

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

I had similar issue on windows as well. I reinstalled all of my pacages using npm install and it was working after that. Try it.

npm install and npm start is error 😦