DEV Community

MohinishTeja
MohinishTeja

Posted on

React Installation Issue

Hello,

I have been trying to install React in my PC frfom past 24 hours and couldn't do it.
I followed the following procedure:

1) node.js in C drive
2) node version 12.16.1
3)npm version 6.14.2
4) Windows 10
5) then I followed: npx create-react-app my-app
6) cd my-app
7) npm start

But the following errors show up when I hit npm start

> my-app@0.1.0 start C:\Users\mohin\my-app
> react-scripts start

i 「wds」: Project is running at http://192.168.1.33/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\mohin\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...

events.js:288
      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! my-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-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\mohin\AppData\Roaming\npm-cache\_logs\2020-03-18T11_34_42_137Z-debug.log

I tried deleting node-modules and reinstalling and even cleared catche.
I tried every way I know but I couldn't find solution

I thought it was showing error for LIVE SERVER step so maybe I can still use it without live server but when i open index.html in public folder there is no output.

Please help me.

I really want to learn in this break quickly.

Top comments (15)

Collapse
 
ajaypatel profile image
FoodBite

If your system is windows, set your environment variable, add %SystemRoot%\system32 to your PATH I met this error yesterday,hope it works to you. Don't forget reboot you PC

Collapse
 
amsaighi profile image
Amin SAIGHI

Hello,

I had to say thank you, I didn't find the solution, I tried all the method proposed in internet etc .. and now it work.
the question is :
before I add the environment variable, I work with angular I don't have the problem,
but when I switch to react native I get this problem why ?

and why we should add this %SystemRoot%\system32 to our PATH ?

Thank you

Collapse
 
mdmostafa15 profile image
mdmostafa15

thank you Amin SAIGHI, this is also work for me.
i added path:- C:\Windows\System32 in environment variable.

Collapse
 
mohinishteja profile image
MohinishTeja

Is it for nodejs?

Collapse
 
defaultjarr profile image
DefaultJARR

love u :D

Collapse
 
ajaypatel profile image
FoodBite • Edited

Yup
Beauty of this community is everyone is helpful when you're in trouble :)

Consider watching travery media's react crash course if you're new to react

Thread Thread
 
mohinishteja profile image
MohinishTeja

Hey can I get your contact details like mail or some chat platform ID? I need your help for learning React :-)

Thread Thread
 
ajaypatel profile image
FoodBite

Yes for sure, you can always use my email
adarshpandya0@gmail.com :)

Collapse
 
mohinishteja profile image
MohinishTeja

Man,It worked without any difficulty. Thanks for the help. been trying a lot for this frompast 24 hours.

Collapse
 
nazir021 profile image
Md. Nazir Ahmed • Edited

this is not working for me.
any help?

Collapse
 
deepanshu207_21 profile image
deepanshu singh

Open the command Prompt as Administrator and then install the packages.. It will 100% surely work.

Collapse
 
lokeshkarki profile image
Lokesh Karki

Hey, can you provide full path? I am confused.

Collapse
 
lokeshkarki profile image
Lokesh Karki

Thank you, it worked.

Collapse
 
rpraneeth profile image
rpraneeth

i am having the same issue help me

Collapse
 
deepanshu207_21 profile image
deepanshu singh

It's simple... Make sure your run the command prompt as Administrator... Then you won't get any error...