首先,我从 expo 中删除了所有导入。然后,我运行了 expo弹出命令。
输出: The output of expo eject command
我选择了第一个选项。然后,我运行了该应用程序,并在 react-native-elements 中发现 @ expo / vector-icons /...的错误。
错误: expo icons error
我的 package.json 文件可能会有所帮助:
{
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios"
},
"dependencies": {
"@babel/runtime": "^7.0.0",
"axios": "^0.18.0",
"colorsys": "^1.0.22",
"eslint-plugin-babel": "^5.3.0",
"galio-framework": "^0.5.1",
"native-dns": "^0.7.0",
"randomcolor": "^0.5.4",
"react": "16.5.0",
"react-native": "0.57.1",
"react-native-action-button": "^2.8.5",
"react-native-animatable": "^1.3.2",
"react-native-dropdownalert": "^3.11.0",
"react-native-elements": "^1.0.0",
"react-native-keyboard-aware-scrollview": "^2.0.0",
"react-native-linear-gradient": "^2.5.3",
"react-native-modal-datetime-picker": "^6.1.0",
"react-native-picker-select": "^6.1.0",
"react-native-pure-chart": "^0.0.24",
"react-native-scl-alert": "^1.2.1",
"react-native-sectioned-multi-select": "^0.6.5",
"react-native-status-bar-height": "^2.3.1",
"react-native-svg": "^9.4.0",
"react-native-svg-charts": "^5.2.0",
"react-native-svg-uri": "^1.2.3",
"react-native-table-component": "^1.2.0",
"react-navigation": "^3.1.4",
"react-navigation-redux-helpers": "^2.0.9",
"react-recaptcha": "^2.3.10",
"react-redux": "5.0.7",
"redux": "4.0.0",
"redux-logger": "3.0.6",
"redux-thunk": "2.2.0",
"url": "^0.11.0",
"uuid": "^3.3.2",
"victory-native": "^32.0.2"
},
"devDependencies": {
"babel-eslint": "^10.0.1",
"babel-preset-expo": "^5.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "17.1.0",
"eslint-config-google": "^0.12.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-react": "^7.12.4",
"espree": "^5.0.1",
"react-devtools": "^3.6.0"
},
"private": true
}
为什么即使退出,我的项目中也有与EXPO相关的内容?以及如何解决这个问题。
更新: 我尝试按照建议的here运行这些文件,但出现相同的错误:
rm -rf node_modules yarn.lock package-lock.json
yarn && yarn add react-native-elements
yarn add react-native-vector-icons
react-native link react-native-vector-icons
我也按照建议的here进行了尝试,但是出现错误,它无法解决expo:
yarn add @expo/vector-icons --save