Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-react-app doesn't work #2803

Closed
shivamgupta-gupta opened this issue Jul 17, 2017 · 13 comments
Closed

create-react-app doesn't work #2803

shivamgupta-gupta opened this issue Jul 17, 2017 · 13 comments

Comments

@shivamgupta-gupta
Copy link

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.

@afontcu
Copy link

afontcu commented Jul 17, 2017

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!

@shivamgupta-gupta
Copy link
Author

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?

@afontcu
Copy link

afontcu commented Jul 17, 2017

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!

@gaearon
Copy link
Contributor

gaearon commented Jul 17, 2017

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.

@gaearon gaearon closed this as completed Jul 17, 2017
@shivamgupta-gupta
Copy link
Author

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.

@DavidNorena
Copy link

I had the same problem with node v8 ended downgrading to v6

@ShruthiJayaprakash
Copy link

I faced the same issue. I am a windows 10 user and what i did is add environment variable C:\Users{user}\AppData\Roaming\npm in system variable PATH. It worked for me.

@ghost
Copy link

ghost commented Nov 29, 2017

I updated the Node on my computer, after that I ran Command Line as an Administrator and it worked for me.

@Ulrikp32
Copy link

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

@DavidNorena
Copy link

@JayStackKrisz @Ulrikp32 maybe its a good workaround but its a security issue to run npm install whatever as windows admin, or linux root ....

@falakejaz
Copy link

falakejaz commented May 3, 2018

I had the same issue I reinstalled my node and the do the following
npm install -g create-react-app

@wangxx1412
Copy link

try re-install npm install -g create-react-app, that may update some packages

@mrmckeb
Copy link
Contributor

mrmckeb commented Jan 20, 2019

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.

@lock lock bot locked and limited conversation to collaborators Jan 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants