Issue starting React - reactjs

I am running an ubuntu shell on windows and when i try to "npm start" I get this error. Anyone else having this issue?
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe 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! awesome-project#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the awesome-project#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! /home/tyronsamaroo/.npm/_logs/2019-09-07T19_46_59_272Z-debug.log

Are you on Windows?
You might not have the system path environment variable. Try to run this in your terminal, and then run the command again.
export PATH=$PATH:C:\Windows\System32

Related

Why am I getting this error when I try to start react?

I installed node JS in my device only last week and its version is 12.18.1 and npm version is 6.14.5 .
npx create-react-app is working and I get all the node modules and other files but when I try to start it gives be following error. PS: I changed the folder and then started as npm start.
npm start
Starting the development server...
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! projectreact#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the projectreact#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\user\AppData\Roaming\npm-cache\_logs\2020-06-28T06_35_26_852Z-debug.log
Please help developers!!
You can try using command :
lsof -i : port number
to get list of all the processes running on the port.
And then kill the process using command kill -9 Process Id

Is something am i missing while creating an React app?

I have created a react app and when I run it shows the following errors. Firstly I thought I made a mistake while creating the app. After that, I have deleted it and created another app and it shows the same errors!
events.js:200
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:81:21)
Emitted 'error' event on ChildProcess instance 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:81:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! fruit_details#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fruit_details#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\abhis\AppData\Roaming\npm-cache\_logs\2020-01-09T06_29_21_939Z-debug.log
Maybe this is a problem with react-scripts. Simply go to your folder in command and reinstall using following command this:
npm install react-scripts#2.1.8
npm start

Exception while trying to start the server using npm start command

After creating the app in vscode, I am unable to load the server port 3000. I am getting below exception
"app#0.1.0 start D:\React\app
react-scripts start
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd 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! app#0.1.0 start: react-scripts start
npm ERR! Exit status 1enter code here
npm ERR!
npm ERR! Failed at the app#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*******\AppData\Roaming\npm-cache_logs\2019-08-05T17_08_42_058Z-debug.log"
Try delete node_modules folder install again with npm install
then npm cache clean --force
then npm start

React app does not start server with npm start

I created a new react app using CRA. As soon as I started the development server, it throws the error and exits.
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd 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! cart-redux#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cart-redux#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logg
ing output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2019-05-26T09_32_50_014Z
-debug.log
The react-scripts version 3.0.1 is avoiding to 'npm start'. I tried downgrading to version 2.1.8, it works fine. But I don't want to downgrade the version everytime to make my app work.
I tried following the similar case, but it didn't help.
Any one else facing the issue, please help to resolve it.
if you tried this and it didn't work for you then this maybe a react-scripts issue so to fix it try this:
remove node_modules and lock files
edit package.json so the version of react-scripts is "2.1.8"
npm install
npm start
LTK how that goes

How to fix "Error: spawn cmd ENOENT" while installing create-react-app?

I am installing a create-react-app.
I have already managed to do it few weeks ago, but this time it doesn't work. It throws an error when I do the command 'npm start'.
I followed the tutorial on reactjs.org.
I have uninstalled and reinstalled latest version of nodejs (v10.15.3). My version of npm is : 6.9.0.
Any clue to help to solve this issue? Thanks
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn cmd 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! memory#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the memory#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\Amelie\AppData\Roaming\npm-cache\_logs\2019-05-07T12_02_27_185Z-debug.log
C:\Users\Amelie\Documents\Formation Développeur WEB\React OCR\memory>.\node_modules.bin\eslint
Le chemin d’accès spécifié est introuvable.
C:\Users\Amelie\Documents\Formation Développeur WEB\React OCR\memory>
Try downgrading your react-scripts dependency to ^2.1.8 in your package.json file.
It worked for me

Resources