Marijan Milovec Marijan Milovec - 5 months ago 49
React JSX Question

zsh: command not found: create-react-app on ubuntu 17.04

I can't get react work on Ubuntu, I just get command not found, can't fix it.

npm install -g create-react-app

/home/name/.npm-global/bin/create-react-app -> /home/name/.npm-global/lib/node_modules/create-react-app/index.js
+ create-react-app@1.4.0
updated 1 package in 4.61s

after that I enter:

create-react-app app

zsh: command not found: create-react-app

.zshrc file

export PATH=$HOME/.node_modules_global/bin:$PATH

I understand that obviously is in path problem, but I can't figure it out, I have some experience with Linux, but I just can't fix this and to get react work.


Ubuntu 17.04
node v8.4.0
npm v5.3.0

Thank you.

Answer Source

Seems to me that you need to add ~/.npm-global/bin/ to your $PATH:

export PATH=~/.npm-global/bin/:$HOME/.node_modules_global/bin:$PATH