Reputation: 525
After running react-native init reactApp
I get a warning npm WARN [email protected] requires a peer of react@~15.4.0-rc.4 but none was installed
. The build is successful though and here is my package.json after the build.
{
"name": "reactApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "15.4.1",
"react-native": "0.39.2"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "18.0.0",
"react-test-renderer": "15.4.1"
},
"jest": {
"preset": "react-native"
}
}
Is this an issue? Should I change the react version and then run npm install
? I'm completely new to react/react-native so any advice would be appreciated as to best practices to prevent errors in the future.
Thanks!
Upvotes: 4
Views: 1493
Reputation: 11
I too had this issue. Updating react/react-native versions to the latest fixed my problem.
"react": "^16.0.0-beta.5",
"react-native": "0.47.0",
"react-test-renderer": "^16.0.0-beta.5"
Upvotes: 0
Reputation: 2084
React Native will work with earlier versions of React, but it's not guaranteed. If you want to, you can update your React version to fix the peer dependency.
Upvotes: 0
Reputation: 20286
I've been working with React Native for like 3 weeks. While running react-native init Proj
I had similar warning:
npm WARN [email protected] requires a peer of react@~15.4.0-rc.4 but none was installed.
and also
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global [email protected] should be installed with -g
However, it did not affect my work. I haven't faced any problems while writing the code and running it.
You can always run:
npm install --save [email protected]
and it should fix it but your version is currently the newest one so I would not do it.
Upvotes: 1