[英]Why won't my React Native app run on my device
I want to be able to test my app on Expo
(an IPhone app used to test React Native code after you hit save) and I just can't seem to get past this error I'm getting Terminal
. 我希望能够在Expo
上测试我的应用程序(在您点击保存后用于测试React Native代码的iPhone应用程序),而我似乎无法摆脱这个错误,而我正在获得Terminal
。 I've ran my app using Expo
before with no problems but now after trying to include a Navigator in my app, I get an error. 我之前使用Expo
运行过我的应用程序没有问题,但是现在尝试在应用程序中包含导航器后,出现错误。
First I did this: 首先,我这样做:
$ npm i -g create-react-native-app
$ create-react-native-app my-project
$ cd my-project`
Then I wanted to include a Navigator in my app so I went ahead and did this: 然后我想在我的应用程序中包含一个导航器,所以我继续这样做:
npm install --save react-navigation
After that, in order to get Expo
running I did: 在那之后,为了使Expo
运行,我做了以下操作:
npm start
When I do npm start
, I get this error in Terminal
: 当我执行npm start
,在Terminal
出现此错误:
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! Mestro@0.1.0 start: `react-native-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the Mestro@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
my guess would be that you are using npm5, I would recommend using npm4, npm5 is currently (as of june 17, 2017) very buggy. 我的猜测是您正在使用npm5,我建议您使用npm4,npm5当前(截至2017年6月17日)非常容易出错。 see this recommendation in the README . 请参阅自述文件中的此建议 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.