Npm ERR! code ELIFECYCLE after trying to create a project

Hello guys,

I am trying out now React, I’ve installed it on my Windows 10 machine, also I have npm, I tried to start a first ever React project by running this command at the cmd terminal:

npx create-react-app  todo-react

This initially starts out fine, it creates a series of messages on the terminal when the command is working however near the end there is an error and no project gets created.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\WINDOWS\system32\cmd.exe
npm ERR! file C:\WINDOWS\system32\cmd.exe
npm ERR! path C:\WINDOWS\system32\cmd.exe
npm ERR! errno -4058
npm ERR! core-js@2.6.12 postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! spawn C:\WINDOWS\system32\cmd.exe ENOENT

I think it has to do with a path since the error that it logs at the terminal.
I am attarching a screen shot of
1.- The terminal (cmd) with the error
2.- The paths for my computer


Has someone had this problem? and if you have can you point me in the right direction?

I appreciate you reading this and I hope you have a great rest of your day.

Hi @siulgh!

I tried googling a few of the error messages and most results led me stackoverflow.

So you might want to try that route.

Good luck!

1 Like

Hi Jessica,

I did solve the problem I was having with npm, React, path

This is what I did:
I double checked the path for my computer, my environmental path was OK
I double checked and read suggestions to update node, and react to latest versions, OK
I then restarted my computer and tried the whole thing again, ERR! (the same error codes)
–> I then read a few stack overflow discussions on this topic, it turns out that my folder location for my React projects was using causing issues as the folder path was too convoluted (a windows 10 issue) not found with other OS.

So I changed the windows folder path to my project from this:

C:\Users\siulg\Google Drive\Documents\Career\Developer Training\developer.mozilla\Javascript Tutorial\Intermediate Level\Client-side web APIs\Client-side JavaScript frameworks\Getting started with React

to a new folder path like this:

> C:\Users\siulg\Google Drive\Documents\Career\Developer Training\developer.mozilla\React

The command now runs great and no errors !

Thank you for your reply, your suggestion was most helpful in my research for this issue, I appreciate the advise.

Have a wonderful rest of your day,

1 Like