0

Please find the error logs which I am getting in the terminal

fruits-vegetables@0.1.0 start C:\Users\MY PC\My_Front_End\fruits-vegetables
> react-scripts start
Could not find a required file.
  Name: index.html
  Searched in: C:\Users\MY PC\My_Front_End\fruits-vegetables\public
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fruits-vegetables@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fruits-vegetables@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\MY PC\AppData\Roaming\npm-cache\_logs\2019-12-20T15_57_41_927Z-debug.log

Please find the debug error log

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\\MY PC\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.13.4
3 info using node@v12.10.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle fruits-vegetables@0.1.0~prestart: fruits-vegetables@0.1.0
6 info lifecycle fruits-vegetables@0.1.0~start: fruits-vegetables@0.1.0
7 verbose lifecycle fruits-vegetables@0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle fruits-vegetables@0.1.0~start: PATH: C:\Users\MY PC\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\MY PC\My_Front_End\fruits-vegetables\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\MY PC\AppData\Local\Microsoft\WindowsApps;C:\Users\MY PC\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\MY PC\AppData\Roaming\npm;C:\Program Files\Git\bin;C:\Program Files (x86)\Nmap
9 verbose lifecycle fruits-vegetables@0.1.0~start: CWD: C:\Users\MY PC\My_Front_End\fruits-vegetables
10 silly lifecycle fruits-vegetables@0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle fruits-vegetables@0.1.0~start: Returned: code: 1  signal: null
12 info lifecycle fruits-vegetables@0.1.0~start: Failed to exec start script
13 verbose stack Error: fruits-vegetables@0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\MY PC\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:209:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\MY PC\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:209:13)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid fruits-vegetables@0.1.0
15 verbose cwd C:\Users\MY PC\My_Front_End\fruits-vegetables
16 verbose Windows_NT 10.0.18362
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\MY PC\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.10.0
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error fruits-vegetables@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the fruits-vegetables@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 ]

Moreover, I have already tried these suggestions:

  1. delete node modules and package-lock.json
  2. then ran command: npm update
  3. then ran command: npm install
  4. and when I ran npm start I got the same error as above

One more thing which I noticed, whenever I freshly install a react app then I used to get App.js, index.js, index.html even a src folder, I am not getting all these. Please help!

pydeveloper
  • 11
  • 1
  • 7
  • It's looking for `C:\Users\MY PC\My_Front_End\fruits-vegetables\public\index.html` that is not present on your disk... Does this file exists ? – BENARD Patrick Dec 20 '19 at 16:31
  • delete create-react-app global installation and then reinstall it and then try again – Rakesh Jain Dec 20 '19 at 16:37
  • thanks for your reply, will do it now Can you please confirm why other folders like public, src are not being appeared after re-installation? since usually it doesn't happen – pydeveloper Dec 20 '19 at 16:41

1 Answers1

0

I'm also faced this issue before but fortunately i fixed it for ever you can fix this by going to the ->control pannel ->system and security ->system-> advanced system settings ->environment variables look for system variables and look for ComSpec make sure the path is like this C:\Windows\system32\cmd.exe and restart the system and see it will work

Hashim aslam
  • 243
  • 1
  • 2
  • 7
  • Thanks Hashim! I will check and let you know – pydeveloper Dec 20 '19 at 18:55
  • Sure , I hope this will work because i was stuck with this issue almost for 2 months i used these two commands create-react-app expense_manager --scripts-version @nomoreanalog/react-scripts-eslintless" ,"npm install --save-dev babel-plugin-styled-components" to fix previously before i found the above solution – Hashim aslam Dec 20 '19 at 19:15
  • Hey Hashim, I did as per your suggestion. When I went to the system variables then I find that the path was already added and no need to run it separately – pydeveloper Dec 21 '19 at 11:19
  • Now, when I try to create a new project here is the following error which I am receiving now: (see the screenshot) http://prnt.sc/qdxfjn My brain is busted now :( – pydeveloper Dec 21 '19 at 11:26
  • Have you installed "npm install create-react-app -g " ? if you uninstalled it ,please run the above command and proceed again – Hashim aslam Dec 21 '19 at 13:29
  • thanks Hashim!!! It is fixed now I ran npm install create-react-app -g npm cache clean then ran this command: npm – pydeveloper Dec 21 '19 at 21:16
  • Good luck my friend@pydeveloper – Hashim aslam Dec 23 '19 at 10:13