Installation and use tutorial of yarn

Table of contents

I. Introduction

2. The difference between npm and yarn, both package management tools

Three, yarn installation

4. Summary


I. Introduction

I have published an introduction and tutorial on using npm to create a react project before. This article introduces and compares the use of yarn here.

Yarn is a new JS package management tool jointly launched by Facebook, Google, Exponent and Tilde. Yarn appeared to make up for some of the shortcomings of npm.

2. The difference between npm and yarn, both package management tools

1. Parallel installation: The yarn installation package will perform multiple tasks at the same time, and npm needs to wait for the installation of the previous task to complete before running the next task

2. Offline mode: If you have already installed a package, installing it again with yarn will get it from the cache, and npm will download it from the network

3. Version locking: yarn has a yarn.lock file to lock the version by default to ensure a unified environment, while npm

The post yarn installation and usage tutorial first appeared on Lenix Blog .

This article is reprinted from https://blog.p2hp.com/archives/9113
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment