npm vs yarn in react native

hello folks,

I am mohammed rizwan and now days react native has become very popular for building both Android and IOS app simultaneously. so i am writing my experience with npm and yarn in react native.

To start project in react native we have to install react-native-cli as a global library in operating system (Ubuntu,Windows,MAC). We have two ways to install it, first one is by using npm and second one is by yarn.

i would suggest you to install yarn after installing react-native-cli by running this command

npm install -g yarn

then you should init your project by running this command

react-native init <YourAppName>

the reason behind this advice is, if you init your project by react-native init <YourAppName>, it first check for yarn in your system, If yarn is available it will crate your project with yarn first else it will init by npm, Yarn is very faster than npm although you cannot install some of dependency by using yarn, you can install it by using npm.

some times you will get errors and execption when you create your project when you use npm, this is because of some bugs in latest npm . you can downgrade your npm version by runnng command in your terminal

npm install npm@3

wish you best of luck for your future project, i hope this might help you little bit and happy new year, May this new year offers you 365 blank pages, write the most beautiful chapter of your life. Happy New Year 2018.

Like what you read? Give Rizwan Chouhan a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.