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.