Advantages and Disadvantages of Yarn According to Npm

Okan Davut
2 min readAug 6, 2021

--

Hi, everyone in this article I will try to example the main differences between YARN and NPM. I know you can find too many articles or videos about this topic. But I am taking notes for myself and sharing them :)

As you know Yarn and NPM both are package managers. These tools allow us to install third-party packages to our project. Yarn was developed by engineers from Facebook. But Npm is developed for Node.js by Isaac N. Schlueter.

You can see examples of installing one package with yarn and npm.

$ yarn add @fortawesome/fontawesome-free$ npm install --save @fortawesome/fontawesome-free

When we look at the code above they are doing the same. So why will I use Yarn according to Npm? Because Npm is the first and known package manager.

Advantages and Disadvantages of Yarn

Before Yarn, all developers were using the Npm for managing packages. So we need to check why Yarn is better or not. You can see the advantages and disadvantages of Yarn below.

Advantages of Yarn

  • Yarn installing packages parallel. But Npm installs the packages one by one. That’s the biggest difference and yarn installs multiple packages same time. So it provides too much performance.
  • Also, Yarn can install packages from the local cache. So it will be fast to update and use.
  • Yarn has a big community. It's an open-source project and continuously developing. Also, you can ask questions on Github easily.

Disadvantages of Yarn

  • Yarn doesn’t have support for Node.js 5.0 previous versions. This is also a big disadvantage.
  • Yarn is not working properly on native modules.

With this article, I just wanted to take a note for myself about package manager differences. I hope it’s useful for you.

Thank you for reading blogpost!

--

--