首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >反应本机:错误: TypeError:无法读取未定义的属性(读取'transformFile')

反应本机:错误: TypeError:无法读取未定义的属性(读取'transformFile')
EN

Stack Overflow用户
提问于 2022-03-04 18:20:22
回答 1查看 5.1K关注 0票数 0

有人能指点我的错误吗,

代码语言:javascript
复制
at Bundler.transformFile (/Users/mobile-app/node_modules/metro/src/Bundler.js:48:30)

at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.transform (/Users/mobile-app/node_modules/metro/src/lib/transformHelpers.js:101:12)
at async processModule (/Users/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:18)
at async traverseDependenciesForSingleFile (/Users/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:131:3)
at async Promise.all (index 0)

at async DeltaBundler.buildGraph (/Users/mobile-app/node_modules/metro/src/DeltaBundler.js:50:5)

info Fetching system and libraries information...
System:
OS: macOS 12.2.1
CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Memory: 557.49 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: Not Found
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Watchman: 2022.02.21.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
  Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
Android SDK:
  API Levels: 23, 28, 29, 30, 32
  Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 32.0.0, 32.1.0
  System Images: android-29 | Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64
  Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8139111
Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.8 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.3 => 0.67.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
EN

回答 1

Stack Overflow用户

发布于 2022-03-07 08:28:28

将@babel/预设-env添加到包中,最终修复了它。如果删除和重新安装node_modules不起作用,请尝试以下操作。

代码语言:javascript
复制
"devDependencies": {
  "@babel/core": "^7.8.4",
  "@babel/preset-env": "^7.16.11",
  "@babel/runtime": "^7.8.4",
  "@react-native-community/eslint-config": "^0.0.7",
  "babel-jest": "^25.1.0",
  "eslint": "^6.8.0",
  "jest": "^25.1.0",
  "metro-react-native-babel-preset": "0.69.0",
  "react-test-renderer": "16.9.0"
},

谢谢

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71355690

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档