error: bundling failed: TypeError: Cannot read property #39;transformFile#39; of undefined, React Native(错误:绑定失败:TypeError:无法读取未定义、本机反应的转换文件#39;的属性)
问题描述
每当我运行REACT-Native Start时都会收到此错误,但这是最近在我的节点模块中安装了Firebase-Tools和Stripe之后开始发生的,但在此之前它运行得很好,下面是错误的堆栈跟踪:
::ffff:127.0.0.1 - - [22/Mar/2020:19:59:30 +0000] "GET /index.bundle?platform=android&dev=true&minify=false HTTP/1.1" 500 - "-" "okhttp/3.12.1"
error: bundling failed: TypeError: Cannot read property 'transformFile' of undefined
at C:UsersmeProject
ode_modules
eact-native
ode_modules@react-native-communitycli
ode_modulesmetrosrcBundler.js:87:34
at Generator.next (<anonymous>)
at asyncGeneratorStep (C:UsersmeProject
ode_modules
eact-native
ode_modules@react-native-communitycli
ode_modulesmetrosrcBundler.js:14:24)
at _next (C:UsersmeProject
ode_modules
eact-native
ode_modules@react-native-communitycli
ode_modulesmetrosrcBundler.js:34:9)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
这是我的包。json:
{
"name": "Project",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"card-validator": "6.2.0",
"firebase-tools": "7.15.1",
"jetifier": "^1.6.5",
"prop-types": "15.7.2",
"react": "^16.13.1",
"react-art": "^16.13.1",
"react-dom": "^16.13.1",
"react-geocode": "0.2.1",
"react-native": "0.61.5",
"react-native-country-picker-modal": "1.9.8",
"react-native-elements": "1.2.7",
"react-native-firebase": "5.6.0",
"react-native-geocoding": "0.4.0",
"react-native-gesture-handler": "1.5.2",
"react-native-maps": "0.26.1",
"react-native-paper": "3.2.1",
"react-native-reanimated": "1.4.0",
"react-native-restart": "0.0.14",
"react-native-shadow": "^1.2.2",
"react-native-svg": "12.0.3",
"react-native-vector-icons": "6.6.0",
"react-native-web": "^0.9.13",
"react-navigation": "4.0.10",
"react-navigation-drawer": "2.3.3",
"react-navigation-stack": "1.10.3",
"stripe": "^8.33.0",
"tipsi-stripe": "7.5.1",
"typescript": "^3.8.3"
},
"devDependencies": {
"@babel/core": "7.7.4",
"@babel/runtime": "7.7.4",
"@react-native-community/eslint-config": "0.0.5",
"babel-jest": "24.9.0",
"eslint": "^5.0.0",
"jest": "24.9.0",
"metro-react-native-babel-preset": "0.56.3",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
我也很清楚另一个问题,它在StackOverflow上也有相同的问题,但这个问题的解决方案对我不起作用,因为NPM在我运行REACT-Native Start时忽略了它,因为这些模块已被弃用,但我仍然收到相同的错误
推荐答案
将NodeJS降级到LTS版本总是有帮助的。当我尝试使用NodeJS^17时,我遇到了同样的问题,但当我将其降级到NodeJS^14并重新安装NODE_MODULES时,一切都被修复了。
这篇关于错误:绑定失败:TypeError:无法读取未定义、本机反应的转换文件';的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误:绑定失败:TypeError:无法读取未定义、本机反应的转换文件';的属性
基础教程推荐
- Karma-Jasmine:如何正确监视 Modal? 2022-01-01
- 响应更改 div 大小保持纵横比 2022-01-01
- 在 JS 中获取客户端时区(不是 GMT 偏移量) 2022-01-01
- 有没有办法使用OpenLayers更改OpenStreetMap中某些要素 2022-09-06
- 角度Apollo设置WatchQuery结果为可用变量 2022-01-01
- 动态更新多个选择框 2022-01-01
- 我什么时候应该在导入时使用方括号 2022-01-01
- 在for循环中使用setTimeout 2022-01-01
- 悬停时滑动输入并停留几秒钟 2022-01-01
- 当用户滚动离开时如何暂停 youtube 嵌入 2022-01-01