繁体   English   中英

在安装npm模块后创建React Native应用并无法运行yarn

[英]Create react native app and yarn not running after installing npm modules

我正在尝试在使用create-react-native-app制作的应用程序中实现react-navigation 问题是在安装npm模块(或任何其他模块)后,没有任何效果。 我收到诸如undefined is not an object (evaluating 'ReactPropTypes.string')构建错误undefined is not an object (evaluating 'ReactPropTypes.string') 用google搜索并关注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

看起来像react和react-native之间的版本不匹配。 对我来说,安装react-native @“ 0.45.1”与react @“ 16.0.0-alpha.12”可以解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM