【发布时间】:2021-05-18 07:46:51
【问题描述】:
我的应用程序没有启动。请帮我。这是代码库的问题吗?
编辑 1: 渲染时的另一个错误
错误:验证 app.json 中的字段时出现问题。见https://docs.expo.io/workflow/configuration/ • 不应有附加属性“nodeModulesPath”。
app.json 文件:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@expo/vector-icons": "^12.0.4",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.11.10",
"@react-navigation/native": "^5.9.4",
"expo": "~41.0.1",
"expo-status-bar": "~1.0.4",
"firebase": "^8.2.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-gesture-handler": "^1.10.3",
"react-native-reanimated": "^1.13.2",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.0.0",
"react-native-stack": "^1.0.0-alpha11",
"react-native-web": "~0.13.12",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"@babel/core": "^7.9.0"
},
"private": true
}
编辑 2:
我卸载了react-native-stack,但是出现错误:Error: Module not found: Can't resolve 'react-native-stack'
我又安装了:
npm install react-native-stack
然后我在渲染中遇到了同样的问题(看第一张图片)并且在控制台中出现了这个错误:
1(黄色)
`Some of your project's dependencies are not compatible with currently installed expo package version:
- react-native-reanimated - expected version range: ~2.1.0 - actual version installed: ^1.13.2
Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]`
2(红色)
`Error: Problem validating fields in app.json. See https://docs.expo.io/workflow/configuration/
• should NOT have additional property 'nodeModulesPath'.`
渲染答案:
`√ Expo Webpack
Compiled successfully in 5.25s
i 「wds」: Project is running at http://0.0.0.0:19006/
i 「wds」: webpack output is served from /
i 「wds」: Content not from webpack is served from C:\Users\Лёха\AppData\Roaming\npm\node_modules\expo-cli\node_modules\@expo\webpack-config\web-default
i 「wds」: 404s will fallback to /
编辑 3
我错了,所以我又把 react-native-stack 删了
npm uninstall react-native-stack
然后我删除了 App.js 文件中的导入:
import {createStackNavigator} from 'react-native-stack'
我仍然在 yarn.lock 文件中,但我认为 rm -rf node_modules 应该可以工作。我只是不明白,如何使用它。
【问题讨论】:
-
删除
useScreens();行。
标签: react-native expo