开始' npm开始'尝试在iPhone上构建React Native应用程序时出错?

时间:2015-05-06 16:29:46

标签: ios node.js react-native

当我对iphone 6进行构建时,我的设备上出现以下错误:红色屏幕:

"Could not connect to development server. Ensure node server is running - run 'npm start' from React root

The operation couldn't be completed.
(NSURLErrorDomain error - 1004)"

我在React Packager的终端中收到以下错误:

"Unhandled rejection Error: ENOENT, open '/Users/rahulsharma/Desktop/rcapp/.git/index.lock'"

最后,我在xcode控制台中得到了这个:

2015-05-06 12:37:48.631 rcapp[808:262187] CLTilesManagerClient: XPC_ERROR_CONNECTION_INVALID!

有什么想法吗?

这是git中的代码:

https://github.com/rahul1346/rcapp

1 个答案:

答案 0 :(得分:0)

看看AppDelegate.m并相应更新。

// To run on device, change `localhost` to the IP address of your computer, and make sure your computer and
// iOS device are on the same Wi-Fi network.
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];