gpt4 book ai didi

reactjs - Metro 遇到错误 "Cannot read property "transformFile"of undefined react native

转载 作者:行者123 更新时间:2023-12-05 04:52:17 31 4
gpt4 key购买 nike

我只是想试试 react-native。但是我得到这个错误。 Metro 遇到错误:无法读取未定义的属性“transformFile”。我在我的物理设备和模拟器上试过了,错误是一样的。我在我的控制台中收到此消息“无法构建转换器:错误:Node Sass 尚不支持您当前的环境:Windows 64 位且运行时不受支持 (88)”

first error

second error

这是我的 package.json 文件

{
"name": "XYZ",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "prettier --write src/**/*.{ts,tsx} && eslint src/**/*.{ts,tsx}"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint && yarn test"
}
},
"dependencies": {
"@apollo/react-hooks": "^3.1.5",
"@react-native-community/async-storage": "^1.12.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^5.9.6",
"@react-navigation/drawer": "^5.9.0",
"@react-navigation/native": "^5.7.3",
"@react-navigation/stack": "^5.9.0",
"@types/react-native-auth0": "^2.5.0",
"apollo-boost": "^0.4.9",
"babel": "^6.23.0",
"babel-core": "^6.26.3",
"babel-upgrade": "^1.0.1",
"date-fns": "^2.16.1",
"metro-config": "^0.59.0",
"react": "^16.13.1",
"react-native": "^0.62.2",
"react-native-auth0": "^2.5.0",
"react-native-dotenv": "^0.2.0",
"react-native-elements": "^2.2.1",
"react-native-gesture-handler": "^1.8.0",
"react-native-google-places-autocomplete": "^1.8.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-reanimated": "^1.13.0",
"react-native-safe-area-context": "^1.0.0",
"react-native-screens": "^2.10.1",
"react-native-skeleton-placeholder": "^2.0.7",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "^12.1.0",
"react-native-swiper": "^1.6.0",
"react-native-tab-view": "^2.15.1",
"react-native-vector-icons": "^7.0.0",
"reanimated-bottom-sheet": "^1.0.0-alpha.20"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/runtime": "^7.11.2",
"@react-native-community/eslint-config": "^1.0.0",
"@types/jest": "^24.0.24",
"@types/react-native": "^0.62.0",
"@types/react-native-dotenv": "^0.2.0",
"@types/react-test-renderer": "^16.9.3",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.27.0",
"babel-jest": "^24.9.0",
"eslint": "^7.7.0",
"eslint-config-airbnb-typescript": "^7.2.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"husky": "^4.2.5",
"jest": "^26.4.0",
"metro-react-native-babel-preset": "^0.58.0",
"node-sass": "^4.14.1",
"prettier": "^2.0.5",
"react-native-sass-transformer": "^1.4.0",
"react-native-svg-transformer": "^0.14.3",
"react-test-renderer": "^16.13.1",
"ts-jest": "^26.2.0",
"typescript": "^3.9.7"
}
}

最佳答案

我卸载了最新版本的 node 并安装了 node 的 LTS(长期支持),它开始工作了

关于reactjs - Metro 遇到错误 "Cannot read property "transformFile"of undefined react native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66577009/

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