create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

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

Open 3nki opened this issue 10 years ago • 30 comments

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

3nki avatar Jul 23 '16 15:07 3nki

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

gaearon avatar Jul 23 '16 18:07 gaearon

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

gaearon avatar Jul 25 '16 14:07 gaearon

$ 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 └─┬ [email protected] ├─┬ [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├─┬ [email protected] │ │ ├── [email protected] │ │ └── [email protected] │ └─┬ [email protected] │ └── [email protected] ├── [email protected] └── [email protected]

3nki avatar Jul 25 '16 15:07 3nki

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

gaearon avatar Jul 25 '16 16:07 gaearon

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

3nki avatar Jul 25 '16 16:07 3nki

Hi!

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

octaviantu avatar Nov 10 '16 11:11 octaviantu

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.

gaearon avatar Nov 10 '16 14:11 gaearon

In case yarn global add create-react-app has been used, I found create-react-app here https://github.com/yarnpkg/yarn/issues/1151#issuecomment-269195959

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

webkay avatar Jan 31 '17 07:01 webkay

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

connelevalsam avatar Mar 05 '17 17:03 connelevalsam

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

praphat avatar Mar 15 '17 08:03 praphat

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

invious avatar Jul 25 '17 15:07 invious

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.

vandoan avatar Aug 28 '17 23:08 vandoan

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

solodisergio avatar Aug 31 '17 10:08 solodisergio

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

hope it will helpful for you guys. :)

shubhamkumardev avatar Sep 07 '17 13:09 shubhamkumardev

@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

marquizzo avatar Oct 04 '17 23:10 marquizzo

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

cafruv avatar Oct 12 '17 06:10 cafruv

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

SYuvaraj avatar Oct 16 '17 18:10 SYuvaraj

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.

SaulNapoles avatar Oct 24 '17 00:10 SaulNapoles

Thanks @vandoan It worked for me

aditya063 avatar Feb 12 '18 06:02 aditya063

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

JGallardo avatar Feb 21 '18 22:02 JGallardo