React Native Package.json配置

在使用React Native过程中会遇到许多问题导致iOS端编译失败,一下是一个测试成功的配置:


{
    "name": "NavigationDemo",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "react": "16.0.0-alpha.6",
        "react-native": "0.44.3"
    },
    "devDependencies": {
        "babel-jest": "20.0.3",
        "babel-preset-react-native": "2.1.0",
        "jest": "20.0.4",
        "react-test-renderer": "16.0.0-alpha.6"
    },
    "jest": {
        "preset": "react-native"
    }
}

在修改完package.json后记得把node-moudles文件夹删除,并在命令行中运行:
npm install以此重新加载相关依赖包。

个人博客:https://blog.xvjialing.xyz

github主页:https://github.com/xvjialing

微信公众号

微信公众号

你可能感兴趣的:(React Native Package.json配置)