Search code examples
reactjsreact-nativefrontendcreate-react-app

npx create-react-app my-app yield result 'create-react-app' is not recognized


I tried to use the 'npx create-react app [project name]' in my project folder but it produced this error

enter image description here

This happened after I deleted the create-react-app.cmd in my C:\Users[myname]\AppData\Roaming\npm folder.

I deleted the file because I had a different problem before where I used the same command but produced "module not found". So someone suggested me to delete the create-react-app.cmd file in my roaming/npm folder. even before doing this, I have tried uninstalling global create-react-app based on the create react app repo.

So was the deletion of create-react-app.cmd the cause to my problem? if so, what should I do to have that file back?


Solution

  • npx came with NPM, so with nodejs.

    Uninstall and reinstall nodejs will fix the problem.