The installation and use of yarn is described in detail _node.js

Source: Internet
Author: User

In the official introduction there is such a sentence:

Yarn is a package manager for your code. It allows to use and share code with other developers from around. Yarn does this quickly, securely, and reliably so don ' t ever have to worry.

The key meaning is fast, safe and reliable. The package you downloaded will not be downloaded again. And make sure you work in different systems.

Quick Install

MacOS

Easy to install on Mac, use initialization script to

 
 

Linux

PO owner's own machine is Ubuntu, installation is relatively simple

Enter command

sudo apt-key adv--keyserver pgp.mit.edu--recv d101f7899d41f3c3 

And then enter the installation command on the line:

 
 

Windows

Need to download MSI file under Windows, download address: Https://yarnpkg.com/latest.msi

NPM's Way

 
 

For installation, you can go to the official website to find more information https://yarnpkg.com/en/docs/install

After the installation is complete, you can test your version

 
 

PS: If you throw yarn: command not found an error, you can go here to find the solution, should all be resolved

Start using

We create a new folder yarn test

Enter command:yarn init

Just enter.

And then we try to add a few dependencies:

 
 

If you add a specific version, you can write it later. @0.x.x

Po main tried to dress up three gulp plug-ins, this time Package.json inside is like this:

If you want to remove, you can use yarn remove package_name such as:

 
 

Upgrade update a dependency can use this:

 
 

Summarize

In short, installation and use are very convenient, pay attention to the Local install node version >=4.0安 will prompt. Installation speed is also very fast, at present they have not publish, but intend to publish try later. As FB claims, fast, reliable, and safe. Yarn is open source, with the attention and use of more and more people, yarn will become better, I believe that some engineers will use yarn and give up NPM. The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.