Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
659 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 Answer

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 :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...