Roger Ramos grayscale profile photo with a nice smile and hat
rogerramos.me

How to fix "create-react-app: command not found"

And there I go. Creating a simple app with react-create-app to test some nice tool, running react-create-app my-nice-app and boom!

-bash: gulp: command not found

The problem

This happen because npm was installed in the wrong directory. The sadness 😞

If you look for the global install location, probably you will find it into /Users/USERNAME/node_modules. You can check this by running npm root or npm root -g.

The solution

To fix it you need to change npm config prefix by running:

npm config set prefix /usr/local

Then reinstall react-create-app

npm i -g react-create-app

Now you can run create-react-app my-nice-app and be happy 😝

References

javascriptreactreact-create-appmacOs
Go back