Even after installing npm instal create-react-app -g globally,
create-react-app ReactApp doesn't work and throws the following error as given below -
E:\Folder\ReactJS>create-react-app helloReact
'create-react-app' is not recognized as an internal or external command,
operable program or batch file.
Any kind of help would be appreciated.
Hi,
Looks like you are using Windows, make sure you added your npm global modules to your PATH variable.
Plus, which npm version are you using? I think there's some kind of bugs with version 5.2.0, so in case you are using that one, you should upgrade to 5.3.0 or even downgrade to latest v4.
Although with that error message I'd go with the PATH issue.
Hope it helps!
Hi @afontcu. Yes I am on Windows 7 and my npm version is 3.10.10 and node version is v6.11.1.
Actually, I tried setting the path as C:\Program Files\nodejs\node_modules\npm to the path in environment variables but it is not working. Can you please specify the exact path variables which I need to append to my create-react-app work?
I'm afraid I'm not using Windows so I can't really tell you the exact path, but search it online, it might help: Stack Overflow, Github.
Hope it helps!
How did you install Node.js? I would recommend reinstalling it with the official installer on the website. Then open "Node.js command prompt" from your Start menu and use that.
I'll close because this question is about Node/npm rather than Create React App itself. If you're having issues with Node I suggest to consult Node specific resources that might have more experts in this area.
Thanks @gaearon for the suggestion for using Node.js command prompt. But that too didn't work.
Actually I was not able to find out where create-react-app file is. But that I was able to locate it at C:\Program Files\Git\usr\local and added it to path variable. And now it works fine.
I had the same problem with node v8 ended downgrading to v6
I faced the same issue. I am a windows 10 user and what i did is add environment variable C:\Users{user}\AppData\Roamingnpm in system variable PATH. It worked for me.
I updated the Node on my computer, after that I ran Command Line as an Administrator and it worked for me.
Hello,
I had the same problem with _npm 5.5.1, node v8.9.2_;
Open cmd as administrator, ie C:\Windows\System32>npm install create-react-app -g then go back to the path you want to create your react app, run create-react-app AppName
@JayStackKrisz @Ulrikp32 maybe its a good workaround but its a security issue to run npm install whatever as windows admin, or linux root ....
I had the same issue I reinstalled my node and the do the following
npm install -g create-react-app
try re-install npm install -g create-react-app, that may update some packages
Hi all, I'd strongly recommend removing your global installs of create-react-app (unless you're doing it very often) and instead using one of the below:
npx create-react-app
yarn create react-app
This ensures you always have the latest version with the latest features - and fixes.
Most helpful comment
I faced the same issue. I am a windows 10 user and what i did is add environment variable C:\Users{user}\AppData\Roamingnpm in system variable PATH. It worked for me.