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

Comments

@3nki
Copy link

@3nki 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

This comment has been minimized.

Copy link
Member

@gaearon gaearon commented Jul 23, 2016

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

@gaearon

This comment has been minimized.

Copy link
Member

@gaearon gaearon commented Jul 25, 2016

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

@gaearon gaearon closed this Jul 25, 2016
@3nki

This comment has been minimized.

Copy link
Author

@3nki 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

This comment has been minimized.

Copy link
Member

@gaearon 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

This comment has been minimized.

Copy link
Author

@3nki 3nki commented Jul 25, 2016

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

@octaviantuchila14

This comment has been minimized.

Copy link

@octaviantuchila14 octaviantuchila14 commented Nov 10, 2016

Hi!

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

@gaearon

This comment has been minimized.

Copy link
Member

@gaearon 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

This comment has been minimized.

Copy link

@webkay 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

This comment has been minimized.

Copy link

@connelevalsam connelevalsam commented Mar 5, 2017

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

@praphat

This comment has been minimized.

Copy link

@praphat praphat commented Mar 15, 2017

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

@invious

This comment has been minimized.

Copy link

@invious invious commented Jul 25, 2017

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

This comment has been minimized.

Copy link

@vandoan 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

This comment has been minimized.

Copy link

@sergioestebance sergioestebance commented Aug 31, 2017

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

@luckyGoodBoy

This comment has been minimized.

Copy link

@luckyGoodBoy luckyGoodBoy commented Sep 7, 2017

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

This comment has been minimized.

Copy link

@marquizzo 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

This comment has been minimized.

Copy link

@cafruv cafruv commented Oct 12, 2017

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

@SYuvaraj

This comment has been minimized.

Copy link

@SYuvaraj SYuvaraj commented Oct 16, 2017

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

@SaulNapoles

This comment has been minimized.

Copy link

@SaulNapoles SaulNapoles commented Oct 24, 2017

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

This comment has been minimized.

Copy link

@aditya063 aditya063 commented Feb 12, 2018

Thanks @vandoan It worked for me

@JGallardo

This comment has been minimized.

Copy link

@JGallardo 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

This comment has been minimized.

Copy link
Contributor

@bondz bondz commented Feb 21, 2018

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

@andriijas andriijas referenced this issue Feb 26, 2018
23 of 23 tasks complete
@dnhyde

This comment has been minimized.

Copy link

@dnhyde 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

This comment has been minimized.

Copy link

@Web-Ghostrider25 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

This comment has been minimized.

Copy link
Contributor

@bondz 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

This comment has been minimized.

Copy link

@Web-Ghostrider25 Web-Ghostrider25 commented Mar 19, 2018

@nupurndas

This comment has been minimized.

Copy link

@nupurndas nupurndas commented Jun 26, 2018

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

This comment has been minimized.

Copy link

@rades12340 rades12340 commented Nov 25, 2018

npm err! unexpected end of JSON input while parsing

Did you found any solution for this?

@nupurndas

This comment has been minimized.

Copy link

@nupurndas nupurndas commented Nov 26, 2018

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

@ugurnur

This comment has been minimized.

Copy link

@ugurnur ugurnur commented Dec 29, 2018

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

@tangzzz-fan

This comment has been minimized.

Copy link

@tangzzz-fan tangzzz-fan commented Jan 5, 2019

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.
Projects
None yet
You can’t perform that action at this time.