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

Setup instructions result in "create-react-app: command not found" #138

Closed
3nki opened this issue Jul 23, 2016 · 30 comments
Closed

Setup instructions result in "create-react-app: command not found" #138

3nki opened this issue Jul 23, 2016 · 30 comments

Comments

@3nki
Copy link

3nki commented Jul 23, 2016

Following the simple setup instructions yields:

-bash: create-react-app: command not found

mac os x 10.11.5, node 6.2, npm 3.8.9

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

Can you try running npm install -g create-react-app again and paste the output?
Thanks.

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

I’ll close because there is not enough information to help you.

@gaearon gaearon closed this as completed Jul 25, 2016
@3nki
Copy link
Author

3nki commented Jul 25, 2016

$ npm install -g create-react-app
(node:1306) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
/usr/local/bin/create-react-app -> /usr/local/lib/node_modules/create-react-app/index.js
/usr/local/lib
└─┬ create-react-app@0.1.0
├─┬ chalk@1.1.3
│ ├── ansi-styles@2.2.1
│ ├── escape-string-regexp@1.0.5
│ ├─┬ has-ansi@2.0.0
│ │ └── ansi-regex@2.0.0
│ ├── strip-ansi@3.0.1
│ └── supports-color@2.0.0
├─┬ cross-spawn@4.0.0
│ ├─┬ lru-cache@4.0.1
│ │ ├── pseudomap@1.0.2
│ │ └── yallist@2.0.0
│ └─┬ which@1.2.10
│ └── isexe@1.1.2
├── minimist@1.2.0
└── semver@5.3.0

@gaearon
Copy link
Contributor

gaearon commented Jul 25, 2016

@3nki Are you able to call any other global Node utilities (e.g. try npm install -g gulp and then call gulp). If not, it’s likely an issue with /usr/local/bin/ not being in your PATH, and you’d need to fix that.

@3nki
Copy link
Author

3nki commented Jul 25, 2016

aha! yup, that seems to have fixed it – thnx!

@octaviantu
Copy link

Hi!

I have the same issue. I've added /usr/local/bin and usr/local/bin/npm to path but the problem persists.

@gaearon
Copy link
Contributor

gaearon commented Nov 10, 2016

You need to figure out where global modules get installed. For example if you don't have /usr/local/bin/create-react-app, figure out where it is. Then add this folder to your PATH.

@webkay
Copy link

webkay commented Jan 31, 2017

In case yarn global add create-react-app has been used, I found create-react-app here yarnpkg/yarn#1151 (comment)

ls ~/.config/yarn/global/node_modules/.bin

@connelevalsam
Copy link

figure out where $PATH is then export it in your .bashrc file and call it in your .profile file like this

@praphat
Copy link

praphat commented Mar 15, 2017

I solved the problem by adding C:\Users\ugur\AppData\Roaming\npm to windows PATH variable.

@invious
Copy link

invious commented Jul 25, 2017

echo 'export PATH="$HOME/.npm-packages/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

@vandoan
Copy link

vandoan commented Aug 28, 2017

For others who are still having an issue and the above solutions haven't work, take a look at this.
I found that Gulp was not working as well and it led me to this fix.
Run.
$ npm config set prefix /usr/local
And then reinstall react.
$ npm install -g create-react-app
The command should work now.
$ create-react-app my-app

Happy coding.

@sergioestebance
Copy link

Thanks @vandoan, that worked for me. Although I'd tried :
/Users/username/.npm-global/lib/node_modules/create-react-app/index.js my-app and worked as well.
Cheers

@shubhamkumardev
Copy link

hey, I had also same problem so I fixed it by reinstalling nodejs of v6.11.3

hope it will helpful for you guys. :)

@marquizzo
Copy link

marquizzo commented Oct 4, 2017

@Luckygoodboy It seems that reinstalling NodeJS (in Windows, at least) adds Node and NPM modules into the PATH environment variables, which is probably what solved the problem behind the scenes for you: NPM Install

@cafruv
Copy link

cafruv commented Oct 12, 2017

For windows 10, add C:\Users{your username}\AppData\Roaming\npm to system path solve this problem.

@SYuvaraj
Copy link

thanks vandoan...your fix worked out for me.

@SaulNapoles
Copy link

try with the command , sudo npm install -g create-react-app , and then create-react-app mywebapp without capital letters, if this don´t work whit the command nano /etc/paths
add /usr/local/bin and /usr/local/bin/create-react-app and try other time, is worked in my mac whit Mac OS High Sierra.

@aditya063
Copy link

Thanks @vandoan It worked for me

@JGallardo
Copy link

JGallardo commented Feb 21, 2018

sudo npm install -g create-react-app appname
where "appname" is what you want your app to be named

@bondz
Copy link
Contributor

bondz commented Feb 21, 2018

@JGallardo sudo will mess up your global installs. Fix your path setup instead.

@andriijas andriijas mentioned this issue Feb 26, 2018
23 tasks
@dnhyde
Copy link

dnhyde commented Mar 6, 2018

If someone still has similar issues running
npx create-react-app my-app

worked for me on OSX High Sierra, node 9.7.1 and npm 5.6.0

@Web-Ghostrider25
Copy link

Web-Ghostrider25 commented Mar 19, 2018

I'm new to ReactJS. I 'm want to install reactjs on my Mac. But I don't know how and what to install?
and suggestions. I've been searching. i was looking at Tutorialspoint installation setup guide, but don't know if works only for windows or mac. i would like to install reactjs most and best up-to-date
version for Mac.
I typed "react -v" in terminal and got this message: "-bash: react: command not found"
what does it mean.

Thanks in advance.

@bondz
Copy link
Contributor

bondz commented Mar 19, 2018

@Web-Ghostrider25 Install the LTS version of NodeJS from https://nodejs.org/en/ and follow the instructions on the readme to get started. It works for all platfroms.

You can check that everything is installed correctly by checking node -v, npm -v, npx -v.
react -v is not going to return anything.

@Web-Ghostrider25
Copy link

Web-Ghostrider25 commented Mar 19, 2018 via email

@nupurndas
Copy link

I did npm install -g create-react-app and then create-react-app sampletwo
create-react-app error

the error says npm err! unexpected end of JSON input while parsing near....

I had used the above commands multiple times before today and projects were created succesfully.

The current npm version is v5.6.0
node version is v8.9.4

please help

@rades12340
Copy link

npm err! unexpected end of JSON input while parsing

Did you found any solution for this?

@nupurndas
Copy link

Try npx create-react-app appname. There should be some path error. Mine's was solved with this.

@ugurnur
Copy link

ugurnur commented Dec 29, 2018

I had the same problem, npx create-react-app worked for me too.

@tangzzz-fan
Copy link

i met this problem too, i used yarn instead. i recommend to use yarn.

@lock lock bot locked and limited conversation to collaborators Jan 10, 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