降级后,react-native 版本和我得到了这个错误。
FAILURE:构建失败并出现异常。
其中:脚本 'E:\GPS-react-native\node_modules@react-native-community\cli-platform-android\native_modules.gradle' 行:195
出了什么问题:评估脚本时出现问题。
内部/模块/cjs/loader.js:818 抛出错误;^错误:在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) 在 Function.Module._load (internal/modules/ cjs/loader.js:667:27) 在 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) 在 internal/main/run_main_module.js:17:47 { 代码:'MODULE_NOT_FOUND',要求堆栈:[]}
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
10 秒内构建失败
这是我降级的 package.json 文件。
{
"scripts": {
"start": "react-native start",
"web": "expo start --web",
"build": "expo build:android",
"build:ios": "expo build:ios",
"fingerprint": "expo fetch:android:hashes",
"ios": "react-native run-ios",
"android": "react-native run-android"
},
"dependencies": {
"@chartiful/react-native-chart-builder": "^0.1.8",
"@chartiful/react-native-vertical-bar-graph": "^0.1.2",
"@miblanchard/react-native-slider": "^1.5.0",
"@react-native-community/masked-view": "^0.1.10",
"axios": "^0.21.1",
"expo": "^40.0.0",
"expo-font": "~8.4.0",
"expo-image-picker": "~9.2.1",
"expo-linear-gradient": "~8.4.0",
"expo-splash-screen": "~0.8.1",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"firebase": "7.9.0",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"native-base": "^2.15.2",
"prop-types": "^15.7.2",
"react": "16.8.3", --------------> only here is different
"react-dom": "17.0.1",
"react-native": "0.59.9", --------------> only here is different
"react-native-chart-kit": "^6.11.0",
"react-native-country-picker-modal": "^2.0.0",
"react-native-display-keyboard": "^0.2.0",
"react-native-easy-grid": "^0.2.2",
"react-native-geocoding": "^0.5.0",
"react-native-gesture-handler": "~1.8.0",
"react-native-google-places-autocomplete": "^2.1.3",
"react-native-maps": "0.27.1",
"react-native-maps-directions": "^1.8.0",
"react-native-modal": "^11.6.1",
"react-native-normalize": "^1.0.1",
"react-native-phone-input": "^0.2.4",
"react-native-progress-circle": "^2.1.0",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.9",
"react-native-screens": "^2.15.2",
"react-native-slider": "^0.11.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-steps": "^1.3.0",
"react-native-svg": "^12.1.0",
"react-native-swiper": "^1.6.0",
"react-native-timeago": "^0.5.0",
"react-native-unimodules": "~0.12.0",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.3",
"react-navigation-stack": "^2.10.2",
"react-redux": "^7.2.2",
"react-viro": "^2.17.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"rn-range-slider": "^2.0.4"
},
"devDependencies": {
"@babel/core": "^7.13.14", --------------> only here is different
"@babel/runtime": "^7.13.10", --------------> only here is different
"babel-jest": "^26.6.3", --------------> only here is different
"jest": "^26.6.3", --------------> only here is different
"metro-react-native-babel-preset": "^0.65.2", --------------> only here is different
"react-test-renderer": "16.8.3" --------------> only here is different
},
"private": true,
"name": "guix",
"version": "1.0.0"
}
这是降级前的 package.json。
{
"scripts": {
"start": "react-native start",
"web": "expo start --web",
"build": "expo build:android",
"build:ios": "expo build:ios",
"fingerprint": "expo fetch:android:hashes",
"ios": "react-native run-ios",
"android": "react-native run-android"
},
"dependencies": {
"@chartiful/react-native-chart-builder": "^0.1.8",
"@chartiful/react-native-vertical-bar-graph": "^0.1.2",
"@miblanchard/react-native-slider": "^1.5.0",
"@react-native-community/masked-view": "^0.1.10",
"axios": "^0.21.1",
"expo": "^40.0.0",
"expo-font": "~8.4.0",
"expo-image-picker": "~9.2.1",
"expo-linear-gradient": "~8.4.0",
"expo-splash-screen": "~0.8.1",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"firebase": "7.9.0",
"lodash": "^4.17.20",
"moment": "^2.29.1",
"native-base": "^2.15.2",
"prop-types": "^15.7.2",
"react": "16.13.1",
"react-dom": "17.0.1",
"react-native": "~0.63.4",
"react-native-chart-kit": "^6.11.0",
"react-native-country-picker-modal": "^2.0.0",
"react-native-display-keyboard": "^0.2.0",
"react-native-easy-grid": "^0.2.2",
"react-native-geocoding": "^0.5.0",
"react-native-gesture-handler": "~1.8.0",
"react-native-google-places-autocomplete": "^2.1.3",
"react-native-maps": "0.27.1",
"react-native-maps-directions": "^1.8.0",
"react-native-modal": "^11.6.1",
"react-native-normalize": "^1.0.1",
"react-native-phone-input": "^0.2.4",
"react-native-progress-circle": "^2.1.0",
"react-native-reanimated": "~1.13.0",
"react-native-safe-area-context": "3.1.9",
"react-native-screens": "^2.15.2",
"react-native-slider": "^0.11.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-steps": "^1.3.0",
"react-native-svg": "^12.1.0",
"react-native-swiper": "^1.6.0",
"react-native-timeago": "^0.5.0",
"react-native-unimodules": "~0.12.0",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.3",
"react-navigation-stack": "^2.10.2",
"react-redux": "^7.2.2",
"react-viro": "^2.17.0",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"rn-range-slider": "^2.0.4"
},
"devDependencies": {
"@babel/core": "~7.12.10",
"babel-jest": "~26.6.3",
"babel-preset-expo": "8.3.0",
"jest": "~26.6.3",
"react-test-renderer": "~17.0.1"
},
"private": true,
"name": "guix",
"version": "1.0.0"
}
为什么我会收到此错误?我该如何解决这个问题?