You have to install react native cli in global. You can use this to do that
npm install react-native-cli -g
I was having a lot of trouble with this, as none of the other answers provided were working. The top answer here was what allowed me to get through my problem: npm global path prefix .
If you get a subsequent EACCES permissions problem, use this so as to not having to go back to square one to fiddle with the npm default directory again:
sudo npm install -g --unsafe-perm=true --allow-root
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.