In this article, we will have explained the necessary steps to install Yarn on Debian 10. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.
Yarn is a java script package manager that enables you to use and share your code with other developers quickly, securely, and reliably through a package which contains all the code being shared as well as a package.json file which describes the package.
Install Yarn on Debian
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
Step 2. Install Yarn.
Now add the Yarn APT repository to your system:
curl-sShttps://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
Importing key add Yarn APT repository using the following command:
echo"deb https://dl.yarnpkg.com/debian/ stable main"|sudotee/etc/apt/sources.list.d/yarn.list
Run the command below to install it:
To verify that Yarn installed successfully, run the following commands which will print the Yarn version number:
Step 3. Using Yarn.
Create a new Project:
The init script will ask you several questions. You can either answer or press enter to use the default values:
To install all the dependencies given inside package.json file use following command:
Following is the basic syntax for adding the dependency:
Congratulation, you have learned how to install and configure Yarn on Debian 10 Buster. If you have any question, please leave a comment below.