ios - react native 应用程序-获取错误app.js无法读取未定义的属性'文件名'

标签 ios react-native jestjs expo

好吧,我没有得到这个错误的任何答案..
npm更新到最新版本并降级也尝试过。
什么都行不通
package.json,所以我得到了一些帮助...

{
  "name": "kelsnew",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "~27.0.0",
    "react-native-scripts": "^1.14.1",
    "react-test-renderer": "16.3.1"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest"
  },
  "dependencies": {
    "expo": "^28.0.0",
    "jest": "^23.4.1",
    "react": "16.3.1",
    "react-native": "^0.56.0"
  }
}

最佳答案

我尝试了几种方法,并尝试了几种方法,但是最终当我将@babel添加到.babelrc插件行中时,没有进行任何其他更改。然后,我删除了node_modulespackage-lock.json并运行了npm install

{
  "presets": ["babel-preset-expo"],
  "env": {
    "development": {
      "plugins": ["@babel/transform-react-jsx-source"]
    }
  }
}

我也一直从Nodejs 8升级到10(并一直呆在那里)。我认为这不是很重要,但是我提到它只是为了以防万一,请检查您的node --version

关于ios - react native 应用程序-获取错误app.js无法读取未定义的属性'文件名',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51548239/

相关文章:

ios - 内存泄漏cocos2D-spriteWithSpriteFrameName

ios - 将 UIVisualEffectView 添加到 UITableView 的背景 View 仅适用于模拟器而非设备

android - 如何使 WebView 在 react-native-webview 中可滚动?

javascript - 模拟服务工作人员-预期响应解析器返回模拟响应对象,但未定义。将使用原始响应

javascript - 我怎样才能使 npm Jest 脚本跨平台而不显得疯狂?

javascript - 测试使用 setTimeout 和 Jest : why is this test failing? 的函数

ios - 添加到测试目标时的 IB 可设计错误

ios - ios 中的 three.js 视频纹理在单独启动的播放器中播放 - 想法?

react-native - react 原生相机条码类型

react-native - 修改index.js后黑屏