create-react-app command not found in ubuntu 16.04 LTS

I tried to install create react app using sudo npm install -g create-react-app on my terminal, then this message appeared:

/home/mahi/.npm-global/bin/create-react-app -> /home/mahi/.npm-global/lib/node_modules/create-react-app/index.js + create-react-app@1.4.3 updated 1 package in 11.7s

Then when I am going to run the command create-react-app hello-world, it says create-react-app command not found. Then I searched for many solutions, I tried almost all of them, but nothing improved, showing the command not found again and again.

2 answers

  • answered 2017-11-12 21:17 Miroslav Papírník

    Are u sure to run npm install with sudo? I had same problem and terminal couldn't write to folder with commands. Does your /usr/local/lib/node_modules/ folder contains create-react-app?

  • answered 2017-11-13 06:19 Elias Ghali

    are you using create-react-app with sudo? because if you installed the package using sudo npm install create-react-app then it is installed for this user, try sudo create-react-app and if it works then you should change ownership to your user