为了解决另一个问题,我必须升级原生react。我使用react-native-git-upgrade 0.54.3进行更新。有没有升级原生版本的想法?
为了开始我的项目,我使用了create-react-native-app
我的package.json包含以下内容:
{
"name": "########",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "23.0.0",
"react-native-scripts": "1.8.1",
"react-test-renderer": "16.0.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^6.3.1",
"exp": "^47.4.4",
"expo": "^23.0.4",
"react": "16.3.0-alpha.1",
"react-native": "0.54.3",
"react-native-swiper": "^1.5.13",
"react-navigation": "^1.5.8"
}
}这张图非常准确地描述了我的问题。

如果尝试执行watchman cmd说watchman未知
更新:
更新了我的package.json:
{
"name": "ProdPrototype",
"version": "0.1.0",
"private": true,
"devDependencies": {
"jest-expo": "^25.1.0",
"react-native-scripts": "^1.11.1",
"react-test-renderer": "^16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^6.3.1",
"connect": "^3.6.6",
"exp": "^50.0.5",
"expo": "^25.0.0",
"react": "16.0.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",
"react-native-swiper": "^1.5.13",
"react-navigation": "^1.5.8"
}
}删除node_modules并运行npm install不起作用,同样的错误。
发布于 2018-03-29 01:10:16
"react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",将此行放入package.json文件的依赖项中
https://stackoverflow.com/questions/49539948
复制相似问题