React-Native生成main.jsbundle

初始化的React-Native会没有main.jsbundle,运行会报错,如图:

React-Native生成main.jsbundle_第1张图片
Simulator Screen Shot - iPhone 6 - 2018-08-29 at 18.36.52.png

解决方案:
1、先CD到你的工程目录下;
2、执行react-native start
3、新建一个命令行窗口,执行curl http://localhost:8081/index.ios.bundle -o main.jsbundle,(PS:有可能localhost不行,这个时候要换成自己本机127.0.0.1)
三个步骤走完后,会生成main.jsbundle在你的工程目录下,拖进主工程中,重新运行就行了

你可能感兴趣的:(React-Native生成main.jsbundle)