当我运行一个react-native项目时,我得到一个错误,没有bundle URL,但我不知道我做了什么错误,我很困惑。


当前回答

解决方案- - - > 然后打开新终端,进入你的项目路径,然后点击 React-native run-ios它适合我

其他回答

Mcafee Macbook用户:

Sudo launchctl remove com.mcafee.agent.macmn

只需在终端react-native启动:

cd your react native app directory/ react-native start 

它将启动打包器,现在不要关闭这个终端窗口,在另一个终端窗口运行你的项目。这是我唯一想要的,让它正常工作。

我尝试了上面的大部分答案。 但唯一有效的是一个watchman命令(我使用react-native: "0.60.4"):

守望watch-del-all

我尝试了下面所有的解决方案,但都不起作用:

Sudo xcodebuild -license或 使用rm -r build删除build文件夹并运行react-native run-ios或 NPM启动并运行react-native run-ios 添加NSAppTransportSecurity到localhost

我是这样解决的:

打开主机文件sudo vi /private/etc/hosts(如果你使用VSCode,使用这个sudo code /private/etc/hosts) 如果不存在,添加三行

127.0.0.1 localhost
255.255.255.255 localhost
::1 localhost

再次运行react-native Run -ios。

我不得不在一个单独的终端上运行“react-native start”。由于某种原因,它不运行了

编辑:另外,这是必要的,因为文件权限设置不正确。我能够通过在受影响的项目目录中运行以下命令来修复它。

chmod 777 node_modules/react-native/scripts/ launchpacker .command