【问题标题】:Create react native app and yarn not running after installing npm modules安装 npm 模块后创建反应本机应用程序和纱线不运行
【发布时间】:2017-11-13 22:50:08
【问题描述】:

我正在尝试将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

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 非常感谢!傻我。它解决了这个问题,然后我得到了另一个构建错误,然后我通过更改 xcode 中的标头搜索路径来解决。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-15
    • 2017-10-22
    • 2020-06-04
    • 2022-08-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多