0

I created a new project with create-react-app: version 3.4.0 and then I ran 'npm start' and it gives me the following an error, I will copy paste it below this message.

I searched everywhere and couldn't find a good solution for this issue. A 'bad' solution would be to downgrade the react-scripts package to react-scripts@2.1.8 or another solution I think it will be to reinstall windows 10. Is there a better solution for this? (and still use react-scripts 3.4.0)

Error message: 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Users\amoraras\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'start' 1 verbose cli ] 2 info using npm@6.14.2 3 info using node@v12.16.1 4 verbose run-script [ 'prestart', 'start', 'poststart' ] 5 info lifecycle cleanreactstartapp@0.1.0~prestart: cleanreactstartapp@0.1.0 6 info lifecycle cleanreactstartapp@0.1.0~start: cleanreactstartapp@0.1.0 7 verbose lifecycle cleanreactstartapp@0.1.0~start: unsafe-perm in lifecycle true 8 verbose lifecycle cleanreactstartapp@0.1.0~start: PATH: C:\Users\amoraras\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\work\temp test\cleanreactstartapp\node_modules.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;H:\bin;C:\work\temp test\cleanreactstartapp\node_modules.bin;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\nodejs;C:\Program Files\nodejs\npm;C:\Program Files\nodej;C:\Users\amoraras\AppData\Roaming\npm";C:\Users\amoraras\AppData\Local\Microsoft\WindowsApps;C:\Users\amoraras\AppData\Roaming\npm;C:\Program Files\nodejs;C:\Program Files\nodej;C:\Users\amoraasu\AppData\Roaming\npm";C:\Windows\system3;C:\Windows;C:\Windows\System32\Wbem" 9 verbose lifecycle cleanreactstartapp@0.1.0~start: CWD: C:\work\temp test\cleanreactstartapp 10 silly lifecycle cleanreactstartapp@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ] 11 silly lifecycle cleanreactstartapp@0.1.0~start: Returned: code: 1 signal: null 12 info lifecycle cleanreactstartapp@0.1.0~start: Failed to exec start script 13 verbose stack Error: cleanreactstartapp@0.1.0 start: react-scripts start 13 verbose stack Exit status 1 13 verbose stack at EventEmitter. (C:\Users\amoraras\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:311:20) 13 verbose stack at ChildProcess. (C:\Users\amoraras\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:311:20) 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 14 verbose pkgid cleanreactstartapp@0.1.0 15 verbose cwd C:\work\temp test\cleanreactstartapp 16 verbose Windows_NT 10.0.18362 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\amoraras\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "start" 18 verbose node v12.16.1 19 verbose npm v6.14.2 20 error code ELIFECYCLE 21 error errno 1 22 error cleanreactstartapp@0.1.0 start: react-scripts start 22 error Exit status 1 23 error Failed at the cleanreactstartapp@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 ]

1 Answers1

1

If you are using windows as I do here are the solving steps that worked in my case:

  1. Go to View advanced system settings
  2. Environment Variables
  3. Add to path the following %SystemRoot%\system32
  4. Reboot
  5. remove node-modules
  6. npm i react-scripts@latest
  7. npm i
  8. npm start

My problem was that I modified the system variables.