React-native iOS终端命令运行:react-native run-ios --simulator "iPhone 6s"出现红屏错误,错误信息如下:
No bundle URL present
Make sure you're running a packager server or have included a .jsbundle file in your application bundle
我这边的解决方案是先删除项目目录下的node_modules里的依赖包,然后重新下载node_modules,最后重新运行:react-native run-ios --simulator "iPhone 6s"命令,就可以打开应用了。
执行步骤
删除依赖包:rm -rf node_modules
重新下载:npm install
运行项目:react-native run-ios --simulator "iPhone 6s"
补充
运行项目可以直接输入:react-native run-ios,其默认打开的模拟器是iPhone 6,后面加上“--simulator”可以打开指定版本的模拟器!
最后插一句,觉得有用的同学,可以点个赞哟^ ^!!!
网友评论