Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
657 views
in Technique[技术] by (71.8m points)

'react-native' is not recognized as an internal or external command, operable program or batch file

I recently started with react-native. I install it using the tutorial on the facebook site and everything works well for a day or two, until this message comes up:

'react-native' is not recognized as an internal or external command,
operable program or batch file.

Nothing works except uninstalling everything and starting all over again. The environments are ok and work (npm, choco, etc.). I have also tried removing and adding react-native to environment variables, restarting, running cmd in administrator mode, but nothing so far. I should add that I use windows 10 64-bit.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same issue and tried the following but didnt work 1) Adding npm path to my Environment variables; both system and user 2) Re install npm and react-native-cli

Both didn't work for me, im using Windows 10;

Solution that worked for me is to install react-native-cli globally You can install it globally by using the below command:

npm install -g react-native-cli

Hope that helps you! Cheers :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...