Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

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

npm - I get 'react-native' is not recognized as an internal or external command when I run "npx react-native init AwesomeProject"

I have installed node and jdk8 using chocolaty.

While I was following the official guide "Setting up the development environment -> React Native ClI Quick start for 'Windows & Android'" I get the following error when I run npx react-native init AwesomeProject command:

'react-native' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code 1
npm ERR! path E:UOGReact_Native_ProjectsMyFirstApp
npm ERR! command failed
npm ERR! command C:WINDOWSsystem32cmd.exe /d /s /c react-native init AwesomeProject

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersMuhammad SulemanAppDataLocal
pm-cache\_logs2021-01-23T09_10_07_360Z-debug.log
question from:https://stackoverflow.com/questions/65857596/i-get-react-native-is-not-recognized-as-an-internal-or-external-command-when-i

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

1 Answer

0 votes
by (71.8m points)

Run this command

npm install -g react-native-cli

after that just add your npm path to your system variables in environment variables

C:UsersYOUR USERNAMEAppDataRoaming pm


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...