React Native - Can not create new project via react-native-cli when react-native version is > 0.55

I am trying to create new project via react native project via react-native-cli react-native init ProjectName and get the following error

error Found incompatible module info

Visit https://yarnpkg.com/en/docs/cli/add for documentation about this

Error: Command failed: yarn add react-native --exact

Project can be created with the same command when react native version is less then or equal to 0.54

react-native init ProjectName --version react-native@0.54

The following links also did not helped me.

https://github.com/facebook/react-native/issues/14861

https://github.com/yarnpkg/yarn/issues/3227

I came across similar issue. Following are the steps I took to solve it.

  1. Noticed the yarn error occurs due to incompatible node module version. It required node version >= 8.0. For this, I changed the node version using nvm: nvm use 8.0.0

Note: Check first if you have a installed node version >= 8.0 using nvm list. If yes, just use the above command. Otherwise install it by nvm install v8.0.0.

  1. After this, you might come across similar error for npm. I did not have updated npm version. Install latest npm by npm install -g npm@latest

Try to create new react-native project, react-native init HelloWorld.

Comments

Popular posts from this blog

Meaning of `{}` for return expression

Get current scroll position of ScrollView in React Native

Chart JS +ng2-charts not working on Angular+2