Reputation: 304
I think I've broken my node/react-native/react PATHs/installation/links and since yesterday I'm trying to figure out what to do.
The errors are:
zsh: command not found: create-react-app
zsh: command not found: react-native
In my which node
:
/usr/local/bin/node
My npm get prefix
:
/Users/username/.npm-packages
My PATH is:
/Users/username/.rvm/gems/ruby-2.3.0/bin:/Users/username/.rvm/gems/ruby-2.3.0@global/bin:/Users/username/.rvm/rubies/ruby-2.3.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/.npm-packages:/usr/local/bin/node:/Users/username/.rvm/bin
EDIT:
My workaround was uninstalling all the NODE.JS installation
The following is the best way to completely uninstall node + npm:
You may need to do the additional instructions as well:
Upvotes: 3
Views: 8166
Reputation: 62
Use npx
to solve the error "create-react-app: command not found".
Example:
For React JS: npx create-react-app my-app
For React Native: npx react-native@latest init AwesomeProject
or install the package globally by running npm install -g create-react-app
to be able to use the command without the npx prefix.
The fastest way to solve the error is to use the npx
command.
Upvotes: 0
Reputation: 1
Try this: npm -g install react-native OR npm i -g react-native-cli
for zsh error: npm install -g react-native-cli
Upvotes: 0