Search code examples
reactjscreate-react-appgit-bash

create-react-app not recognizable as internal or external command


I am using Git Bash terminal on my Windows 10 machine. I have below versions of node and npm

$ node -v
v12.16.1

$ npm -v
6.13.4

However while running the command $ npx create-react-app my-app I am getting the below error

'create-react-app' is not recognized as an internal or external command,
operable program or batch file.

I have added the create-react-app location till npm in PATH variable and checked its present using the echo command.

Also I am able to run the above npx command in cmd but not in Git Bash. Is there anything different I have to do run it?

PATH : /c/Users/SAURABH/AppData/Roaming/npm

I am able to run the create-react-app by doing the below though:

C:/Users/SAURABH/AppData/Roaming/npm/create-react-app one-hello-world

Not sure why npx is not working

EDIT: I solved by adding the below to PATH

C:\Users\SAURABH\AppData\Roaming\npm\node_modules

But the above path has the create-react-app folder and not the batch file. It should point to some batch file right?


Solution

  • I have same issue on my mac, start using yarn create react-app my-app . This solution works for me.