安装npm模块后,创建反应本机app和纱线未运行

时间:2017-06-12 12:43:32

标签: reactjs react-native npm npm-install react-navigation

我正在尝试将react-navigation实施到使用create-react-native-app制作的应用中。问题是在安装npm模块(或任何其他模块)之后没有任何作用。我得到像undefined is not an object (evaluating 'ReactPropTypes.string')这样的构建错误。 谷歌搜索并跟踪github上的问题,仍然没有找到解决方案。有人可以帮帮我吗?

的package.json

{
    "name": "TestApp",
    "version": "0.1.0",
    "private": true,
    "devDependencies": {
        "jest-expo": "~1.0.1",
        "react-native-scripts": "0.0.31",
        "react-test-renderer": "16.0.0-alpha.6"
    },
    "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": "^17.0.0",
        "react": "^16.0.0-alpha.6",
        "react-native": "^0.45.0",
        "react-navigation": "^1.0.0-beta.11"
    }
}

纱线v0.24.5
npm v3.10.10
Mac OSX Sierra 10.12.5

1 个答案:

答案 0 :(得分:2)

看起来像react和react-native之间的版本不匹配。安装react-native @" 0.45.1"与反应@" 16.0.0-alpha.12"为我解决了这个问题。