DEV Community

NickeaBennett
NickeaBennett

Posted on

Using NPM VS Yarn in React

While most junior Software Engineers tend to gravitate to NPM (Node Package manager) like myself. Most experienced React Engineers gravitate to yarn. Yea! boring right?

Both have similarities and differences but at the end of the day both get the job done.

NPM tends to be on the slow side of things when installing dependencies. However, yarn seems to be a bit slower when starting an application.

The reason behind the slowness of yarn is due to it's validation checks. In all honesty, I really don't mind. I feel a bit safer and confident using yarn over NPM now that I have given it a shot.

Lets briefly compare yarn and npm.

Command                      npm    yarn
Install dependencies:   npm install yarn
Install package: npm install [package]  yarn add [package]
Update:             npm update  yarn upgrade

Enter fullscreen mode Exit fullscreen mode

To learn more about yarn you can visit the official site here: https://classic.yarnpkg.com/en/docs/getting-started

You can also visit Digital Ocean's cheat sheet here: https://www.digitalocean.com/community/tutorials/nodejs-npm-yarn-cheatsheet.

I hope whichever path you choose will lead you to a speedy development process....minus the bugs.

Top comments (0)