Visual Studio Code运行React Native报错

阅读更多

React Native:0.27.2

React:15.1.0

Node:6.1.0

npm:3.8.6

Visual Studio Code:1.2.0

 

运行后报错如下:

######### Attempting to start the React Native packager ##########

######### Starting Packager ##########

######### Executing command: react-native start --port 8081 ##########

[Error : 0105]  Failed to run the application in iOS: spawn react-native ENOENT

 

解决办法:

终端中检查react-native命令的安装目录:which react-native

(1)如果已经安装,设置环境变量即可

(2)如果没有安装,全局安装react-native-cli即可

 

你可能感兴趣的:(iOS,react)