327得票66回答
无法加载脚本。确保您正在运行Metro服务器或者您的打包好的 'index.android.bundle' 在发布时被正确打包。

react-native run-android 命令在安卓模拟器中留下一条消息后终止。该消息如下: 无法加载脚本。请确保您正在运行 Metro 服务器或您的捆绑包 'index.android.bundle'已正确打包以供发布。 我做错了什么?

177得票23回答
如何解决“react-native start”命令出现的错误

我刚刚安装了 Node.js 和 CLI 安装了 Node.js 安装了 React Native 命令行界面(CLI) npm -g react-native-cli 并创建了一个“新项目”。react-native init new_project 在'new_projec...

119得票20回答
无法解析模块`@babel/runtime/helpers/interopRequireDefault`。

创建一个新的React Native项目时,使用标准的react-native init MyApp命令,并且第一次运行react-native run-ios时,我遇到了以下错误: error: bundling failed: Error: Unable to resolve modul...

74得票20回答
无法读取未定义的属性(读取“transformFile”)在打包器.transformFile时发生。

今天我更新了 node,现在出现了这个错误:error: TypeError: Cannot read properties of undefined (reading 'transformFile') at Bundler.transformFile (/Users/.../node...

57得票27回答
没有应用程序连接。发送“reload”到所有React Native应用程序失败。请确保您的应用程序在模拟器上运行或通过USB连接的手机上运行。

我的React Native应用在物理设备上运行时出现了一些问题。 Metro bundler控制台显示了一个警告: warn No apps connected. Sending "reload" to all React Native apps failed. Make sure yo...

52得票6回答
从终端运行React Native iOS发布版本的构建

我想直接从终端运行发布版,但没有找到相应的选项。 在XCode中需要执行以下步骤: 选择Product -> Scheme -> Edit Scheme (cmd + <),确认当前在侧边栏的Run标签下,并将Build Configuration下拉菜单设置为release。...

40得票8回答
错误:`fsevents` 不可用(此监视器仅适用于 Darwin 系统)

我正在本地环境中克隆一个已有的React Native应用程序,但每次运行react-native run-ios命令时,都会出现以下错误: ** BUILD FAILED ** The following commands produced analyzer issues: A...

26得票10回答
React-Native启动时出现“Invalid regular expression invalid”错误

我按照以下链接开始学习react-native: React Native入门指南 我尝试创建没有Expo的原生应用程序,所以根据文件,我执行了以下命令:npm install -g react-native-cli react-native init AwesomeProject 执行...

24得票14回答
如何在React Native CLI中获取SHA-1密钥?

在React Native中,当我尝试在Google控制台中获取Google GPS API密钥时,我看到了包名称和SHA-1密钥。在React Native中,如何获取SHA-1密钥(不是在Expo中)?

23得票2回答
如何使用特定的目标运行react-native run-ios

有没有一种方法可以用命令运行特定的目标react-native run-ios 对于Android,我正在使用以下内容react-native run-android --variant=targetRelease