1

I'm trying React Native out using create-react-native-app version 1.0.0. Upon trying to create a new project, I get the following errors and warnings in the middle of the logs:

    ├── UNMET PEER DEPENDENCY react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0

and

│ ├── UNMET PEER DEPENDENCY react@>=15.3.1

and

npm WARN react-native-gesture-handler@1.0.0-alpha.17 requires a peer of react@>= 16.0.0 but none was installed.
npm WARN react-native-branch@2.0.0-beta.3 requires a peer of react@>=15.4.0 but none was installed.
npm WARN lottie-react-native@1.1.1 requires a peer of react@>=15.3.1 but none was installed.

What is the proper way to resolve these issues?

2 Answers2

0

You're gonna want to make sure your create-react-native-app package is up to date. You might also have a global install of react that's messing things up which is why CRNA isn't able to get react for you.

Do npm upgrade -g create-react-native-app then try again.

If that doesn't work straight off then try removing your global react install and then be sure to add it to your package.json for your local projects. Make sense?

UPDATE: the next thing to try is to manually install the missing packages. npm i -g react

I would imagine CRNA installs react as one if it's dependencies but maybe not...

Are you using nvm to manage your node versions? if so make sure you're using a required node version.

That error is telling you that it can't install React for some reason (which is a problem because, well, you kinda need react). Let me know if upgrading works and if not I'll get some more info from ya and we'll figure it out! cheers.

rimraf
  • 3,925
  • 3
  • 25
  • 55
  • Thanks for helping. I've got the latest CRNA, and I have tried both Node v6 LTS as well as the latest Node 8.4, both of which presumably work with CRNA. This is all new on the machine so there is no old software that could be at play. –  Aug 20 '17 at 13:25
  • hmm... i updated my answer. try to manually install react globally. – rimraf Aug 20 '17 at 15:02
0

I had the same issue on Windows after the first installation of Node.js 8.4.0. I didn't have Node.js installed prior to this.

Did a reinstall of Node.js and after that it worked.