Hello, friends. Installing Yarn on Debian 11 opens the door to NodeJS project management in a fast and efficient way. So, in this post, I will tell you what it is and how to install it so you can get it ready for your projects.
Yarn is a package manager that doubles down as a project manager. Whether you work on one-shot projects or large monorepos, as a hobbyist or an enterprise user, we’ve got you covered.
Its main advantages are stability, speed of work, and ease of use. Another aspect to take into account is that Yarn is open source so we can examine the source code of the application without any problems.
On the other hand, Yarn has support for plugins that further increase the functionality of the application.
So, let’s go for it.
The method recommended by the official Yarn documentation is using
npm and therefore NodeJS. So, this has to be our first step.
After the installation is finished, you can install Yarn on Debian 11 by executing the following command
sudo npm install -g yarn > [email protected] preinstall /usr/lib/node_modules/yarn > :; (node ./preinstall.js > /dev/null 2>&1 || true) /usr/bin/yarn -> /usr/lib/node_modules/yarn/bin/yarn.js /usr/bin/yarnpkg -> /usr/lib/node_modules/yarn/bin/yarn.js + [email protected] added 1 package in 1.073s
Then you can check the installed version with the following command
yarn --version 1.22.11
To always update Yarn to the latest version, you have to run the following command
yarn set version latest
Once we have Yarn installed on our computer the next thing to do is to use it a little bit.
Create a new folder for the new project. For example
Access the folder and start the yarn project as follows
cd project yarn init
And to add dependencies to the newly created project you can run
yarn add [package]
Or specify a specific version
yarn add [package]@[version]
If you want to remove any dependencies, just run
yarn remove [package]
To install all dependencies
yarn yarn install
But you can also update the dependencies
yarn up [package]
Or by specifying a version
yarn up [package]@[version]
Finally, you can access all the Yarn commands by consulting the help
So, enjoy it.
Yarn is a fast tool that allows us to manage the packages of our web project that is more and more used worldwide. In this post, you learned how to install it on Debian 11.