gpt4 book ai didi

react-native - React Native 开发服务器返回响应错误代码 :500

转载 作者:行者123 更新时间:2023-12-04 03:58:34 25 4
gpt4 key购买 nike

该应用程序安装在模拟器中。但它没有开始。模拟器指出我 this错误。

同时服务器给出以下错误。

error: bundling failed: TypeError: Cannot read property 'throwIfClosureRequired' of undefined (While processing preset: "C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\index.js") at _default (C:\Users\sajithk\UTransP\node_modules\babel-preset-react-native\node_modules\@babel\plugin-transform-block-scoping\lib\index.js:19:36) at Function.memoisePluginContainer (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:113:13) at Function.normalisePlugin (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:146:32) at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:184:30 at Array.map () at Function.normalisePlugins (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:158:20) at OptionManager.mergeOptions (C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:234:36) at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:265:14 at C:\Users\sajithk\UTransP\node_modules\babel-core\lib\transformation\file\options\option-manager.js:323:22 BUNDLE [android, dev] ./index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.



这是我在创建项目后第一次在模拟器中运行应用程序。

最佳答案

我遇到了同样的问题,在我的情况下,我通过将 babel-preset-react-native 版本从 5.0.0 更改为 4.0.0 来解决它

并按照说明操作:

  • 清晰的守望者 watch :watchman watch-del-all .
  • 删除 node_modules文件夹:rm -rf node_modules && npm install .
  • 重置 Metro Bundler 缓存:rm -rf /tmp/metro-bundler-cache-*npm start -- --reset-cache .
  • 移除加速缓存:rm -rf /tmp/haste-map-react-native-packager-* .
  • 关于react-native - React Native 开发服务器返回响应错误代码 :500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49994149/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com