ΠΊΠ°ΠΊ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ yarn Π½Π° windows
How to Install Yarn on Windows
What is a Package Manager?
Package Manager is a tool that installs, updates and manages the software packages you need. With the help of such tools, you can always have the latest version of the libraries you need with your software. You can also think only of developing the core of your software without having to search for packages and their peripherals.
Note: Node.js must be installed before installing Yarn.
MSI Installation
accept the license agreement.
And finally, click on the Finish button.
Now, you can verify Yarn was installed using the following CLI commands :
Chocolatey Installation
Another way to install Yarn is by using the Chocolatey package manager for Windows. This method is convenient because Chocolatey will determine whether node.js is already installed and if not, it will automatically install it for us. It is important to do everything as an administrator.
Once Chocolatey is set up, you can install Yarn using the following command:
You can verify your installation of yarn using the following command:
Scoop Installation
The third method of installing Yarn is by using the Scoop command line installer for Windows.
Scoop has functionality that is similar to Chocolatey, but the main difference being that Chocolatey will install node.js if we do not already have it installed but scoop will not.
Scoop can be installed using the information found at the scoop website. To install node.js using scoop, run the following command:
The best method to review many of the Yarn commands is to run the help command:
Start a New Project
Installing Dependencies
Use one of the two following commands, to install all the dependencies for a project:
To add a dependency to a project, use one of the following command formats:
1) dev Dependencies
2) peer Dependencies
3) optional Dependencies
Upgrade Yarn
To upgrade Yarn to the latest version, run one of the following commands:
Also, see:
Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.
How to Install Yarn on Windows
What is Yarn?
Prerequisites
Node.js must be installed before installing Yarn. We can verify if node.js is installed on our system using the Windows terminal or powershell.Π
1. Open the terminal by pressing the Win+R buttons and then enter cmd.Π
2. Using the command line, we can verify if Node.js is installed with the command:
If we do not have node.js installed, we can go to the main node.js website and download the installer.
Next, we need to run the installer.
Now, we should accept the license agreement.
Now, leave all the defaults set and click Next to install node.js.
Finally, click on Finish, to complete the installation. Now we can rerun our command to verify node.js installed correctly using the following command in the terminal:
Yarn Installation
MSI Installation
Now, accept the license agreement.
Then, click Install.
And finally, click on the Finish button.
Now, we can verify Yarn was installed using the following CLI commands.
Chocolatey Installation
Another way to install Yarn is by using the Chocolatey package manager for Windows. This method is convenient because Chocolatey will determine whether node.js is already installed and if not, it will automatically install it for us. It is important to do everything as an administrator. Here are the instructions for installing Chocolatey.
Once Chocolatey is set up, we can install Yarn using the following command.
Finally, we can verify our installation of yarn using the following command.
Scoop Installation
The third method of installing Yarn is by using the Scoop command line installer for Windows. Scoop has functionality that is similar to Chocolatey, but the main difference being that Chocolatey will install node.js if we do not already have it installed but scoop will not. Scoop can be installed using the information found at the scoop website.Π
To install node.js using scoop, run the following command.Π
Next, we can install yarn using this command.
Migrating from Yarn 1
We’ve been compiling helpful advice when porting over from Yarn 1 on the following Migration Guide. Give it a look and contribute to it if you see things that aren’t covered yet! Make sure to consult the PnP Compatibility Table and enable the node-modules plugin if required!
About global installs
For this reason, Yarn 2 and later are meant to be managed on a by-project basis. Don’t worry, little will change! Just make sure to first install the global Yarn binary that we will use to spawn the local ones:
You’ve probably remarked the global Yarn is from the «Classic» line (1.x). This is expected! One extra perk of this system is that projects configured for Yarn 1 will keep using it instead of suddenly having to migrate to the 2.x configuration format. We wouldn’t have had to do this if Yarn had been «project locked» from the beginning, but hindsight is 20/20 😉
«Berry» is the codename for all versions of Yarn from 2 onwards: 2.x, 3.x, etc. It’s also the name of our repository!
Updating to the latest versions
Should you later want to update Yarn to the latest version, just run:
Yarn will then download the most recent binary from our website, and install it in your projects. Don’t forget to run a new install to update your artifacts, and to commit the results!
Installing the latest build fresh from master
From time to time even the most recent releases aren’t enough, and you then will want to try out the very latest master to check if a bug has been fixed. This has become very simple with Yarn 2! Just run the following command:
Yarn 2 β Π£ΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΠΈ ΡΠ°Π·Π±ΠΈΡΠ°Π΅ΠΌΡΡ
ΠΠ½Π°ΠΊΠΎΠΌΡΡΠ²ΠΎ
Yarn 2 (Berry) β ΡΡΠΎ Π½ΠΎΠ²ΡΠΉ Π²ΡΠΏΡΡΠΊ ΡΠ΅Π²ΠΎΠ»ΡΡΠΈΠΎΠ½Π½ΠΎΠ³ΠΎ ΠΈ Ρ ΠΎΡΠΎΡΠΎ Π·Π°ΡΠ΅ΠΊΠΎΠΌΠ΅Π½Π΄ΠΎΠ²Π°Π²ΡΠ΅Π³ΠΎ ΡΠ΅Π±Ρ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΠΏΠ°ΠΊΠ΅ΡΠΎΠ² Yarn, Π²ΠΊΠ»ΡΡΠ°ΡΡΠΈΠΉ Π² ΡΠ΅Π±Ρ ΡΠ°ΠΊΠΈΠ΅ ΠΎΡΠΎΠ±Π΅Π½Π½ΠΎΡΡΠΈ, ΠΊΠ°ΠΊ: PlugβnβPlay, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΡΠ°ΡΡΠΈΡΠ΅Π½ΠΈΡ ΠΌΠΎΠ΄ΡΠ»ΡΠ½ΠΎΠ³ΠΎ API, ΠΎΡΡΠ»Π°ΠΉΠ½-ΠΊΡΡ ΠΈ ΡΠ»ΡΡΡΠ΅Π½Π½ΡΡ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΡ ΡΠ°Π±ΠΎΡΠΈΡ ΠΏΡΠΎΡΡΡΠ°Π½ΡΡΠ².
PlugβnβPlay
Π Π½ΠΎΠ²ΠΎΠΉ Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ Yarn ΠΏΠΎΠ΄ΡΠΎΠ±Π½ΠΎ ΡΠ°ΡΡΠΊΠ°Π·ΡΠ²Π°Π΅ΡΡΡ ΠΎ Π½Π΅Π΄ΠΎΡΡΠ°ΡΠΊΠ°Ρ node_modules, ΠΊΠ°ΠΊ ΡΡΡΡΠΊΡΡΡΡ ΠΏΠ°ΠΏΠΎΠΊ, ΠΈ ΠΎΠ±ΡΡΡΠ½ΡΠ΅ΡΡΡ, ΠΏΠΎΡΠ΅ΠΌΡ Π½Π΅ΠΎΠ±Ρ ΠΎΠ΄ΠΈΠΌ Π½ΠΎΠ²ΡΠΉ Π²Π·Π³Π»ΡΠ΄ Π½Π° ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΡΠΌΠΈ.
ΠΠΎΠ½ΠΎΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΈ
ΠΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎ ΠΎΡ ΡΠΎΠ³ΠΎ, ΡΠ²Π»ΡΠ΅ΡΠ΅ΡΡ Π±Ρ ΠΏΠΎΠΊΠ»ΠΎΠ½Π½ΠΈΠΊΠΎΠΌ ΠΌΠΎΠ½ΠΎΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅Π² ΠΈΠ»ΠΈ Π½Π΅Ρ, ΡΡΠΎΠ±Ρ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠΈΡΡ ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅Π½Π½ΠΎΠ΅ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ Π±ΠΎΠ»ΡΡΠΈΠΌΠΈ ΠΏΡΠΎΠ΅ΠΊΡΠ°ΠΌΠΈ ΠΈ ΡΠ»ΠΎΠΆΠ½ΡΠΌΠΈ ΡΠ°Π±ΠΎΡΠΈΠΌΠΈ ΠΏΡΠΎΡΠ΅ΡΡΠ°ΠΌΠΈ, ΠΏΠΎΡΡΠ΅Π±ΡΠ΅ΡΡΡ Ρ ΠΎΡΠΎΡΠΈΠΉ Π½Π°Π±ΠΎΡ ΠΈΠ½ΡΡΡΡΠΌΠ΅Π½ΡΠΎΠ².
ΠΠΎΠΏΡΠ»ΡΡΠ½ΡΠΌ ΡΠ΅ΡΠ΅ΠΏΡΠΎΠΌ Π½Π°ΡΡΠΎΠΉΠΊΠΈ JavaScript ΠΌΠΎΠ½ΠΎΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ ΡΠ²Π»ΡΠ΅ΡΡΡ ΠΊΠΎΠΌΠ±ΠΈΠ½Π°ΡΠΈΡ ΡΠ°Π±ΠΎΡΠΈΡ ΠΏΡΠΎΡΡΡΠ°Π½ΡΡΠ² Yarn ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Lerna Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ².
Π₯ΠΎΡΠΎΡΠ°Ρ Π½ΠΎΠ²ΠΎΡΡΡ Π·Π°ΠΊΠ»ΡΡΠ°Π΅ΡΡΡ Π² ΡΠΎΠΌ, ΡΡΠΎ ΡΠ΅ΠΏΠ΅ΡΡ Yarn ΠΌΠΎΠΆΠ΅Ρ ΠΎΠ΄Π½ΠΎΠ²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎ Π²ΡΠΏΠΎΠ»Π½ΡΡΡ ΡΡΠ½ΠΊΡΠΈΠΈ ΠΊΠ°ΠΊ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΠΏΠ°ΠΊΠ΅ΡΠΎΠ², ΡΠ°ΠΊ ΠΈ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅ΡΠ° ΠΏΡΠΎΠ΅ΠΊΡΠΎΠ², ΠΏΡΡΠ°ΡΡΡ ΠΎΠ±Π΅ΡΠΏΠ΅ΡΠΈΡΡ ΠΏΠΎΠ»ΠΎΠΆΠΈΡΠ΅Π»ΡΠ½ΡΠΉ ΠΎΠΏΡΡ ΡΠ°Π±ΠΎΡΡ Π² ΡΡΠΎΠΌ Π°ΡΠΏΠ΅ΠΊΡΠ΅.
ΠΠΎΠ΄ΡΠ»ΡΠ½Π°Ρ Π°ΡΡ ΠΈΡΠ΅ΠΊΡΡΡΠ°, ΠΏΠ»Π°Π³ΠΈΠ½Ρ
Π‘Π΄Π΅Π»Π°Π² Π²Π°ΠΆΠ½ΡΠΉ ΡΠ°Π³ Π²ΠΏΠ΅ΡΠ΅Π΄, Yarn 2 Π±ΡΠ» ΠΏΠ΅ΡΠ΅ΡΠ°Π±ΠΎΡΠ°Π½ Π² ΠΏΠΎΠ»ΡΠ·Ρ Π½ΠΎΠ²ΠΎΠ³ΠΎ ΠΌΠΎΠ΄ΡΠ»ΡΠ½ΠΎΠ³ΠΎ API, ΡΠ°ΡΡΠΈΡΡΠ΅ΠΌΠΎΠ³ΠΎ ΠΏΡΠΈ ΠΏΠΎΠΌΠΎΡΡΡ ΠΏΠ»Π°Π³ΠΈΠ½ΠΎΠ². Π Π½Π°ΡΡΠΎΡΡΠ΅Π΅ Π²ΡΠ΅ΠΌΡ Π±ΠΎΠ»ΡΡΠΈΠ½ΡΡΠ²ΠΎ ΡΡΠ½ΠΊΡΠΈΠΉ ΡΠΆΠ΅ ΡΠ΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½ΠΎ Ρ ΠΈΡ ΠΏΠΎΠΌΠΎΡΡΡ β Π΄Π°ΠΆΠ΅ yarn add ΠΈ yarn install ΡΠ²Π»ΡΡΡΡΡ ΠΏΡΠ΅Π΄ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Π½ΡΠΌΠΈ ΠΏΠ»Π°Π³ΠΈΠ½Π°ΠΌΠΈ!
ΠΠ°ΠΊ Π½Π°ΡΠ°ΡΡ ΡΠ°Π±ΠΎΡΡ?
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ°
Yarn ΠΏΡΠΈΠ΄Π΅ΡΠΆΠΈΠ²Π°Π΅ΡΡΡ ΡΡΡΠ°ΡΠ΅Π³ΠΈΠΈ Π³Π»ΠΎΠ±Π°Π»ΡΠ½ΠΎΠΉ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ ΠΏΠ΅ΡΠ²ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ, Π° ΡΠΆΠ΅ Π·Π°ΡΠ΅ΠΌ ΠΏΠ΅ΡΠ΅ΠΊΠ»ΡΡΠ΅Π½ΠΈΡ Π½Π° Π²ΡΠΎΡΡΡ Π΄Π»Ρ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠ³ΠΎ ΠΏΡΠΎΠ΅ΠΊΡΠ°.
Π‘Π½Π°ΡΠ°Π»Π° ΡΡΡΠ°Π½ΠΎΠ²ΠΈΠΌ Π³Π»ΠΎΠ±Π°Π»ΡΠ½ΡΠΉ Yarn, ΠΊΠΎΡΠΎΡΡΠΉ ΠΌΡ Π±ΡΠ΄Π΅ΠΌ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ Π»ΠΎΠΊΠ°Π»ΡΠ½ΡΡ ΡΠΊΠ·Π΅ΠΌΠΏΠ»ΡΡΠΎΠ²:
βBerryβ β ΠΊΠΎΠ΄ΠΎΠ²ΠΎΠ΅ ΠΈΠΌΡ ΡΠ΅Π»ΠΈΠ·Π½ΠΎΠΉ Π²Π΅ΡΠΊΠΈ Yarn 2.
ΠΠ·ΠΌΠ΅Π½ΠΈΠΌ Π²Π΅ΡΡΠΈΡ Yarn ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎ Π΄Π»Ρ ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π° my-app :
ΠΠΎΡΠ»Π΅ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ Π΄Π°Π½Π½ΠΎΠΉ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ° Π±ΡΠ΄Π΅Ρ Π·Π°Π²Π΅ΡΡΠ΅Π½Π°, ΠΈ ΠΌΠΎΠΆΠ½ΠΎ ΠΏΠ΅ΡΠ΅Ρ ΠΎΠ΄ΠΈΡΡ ΠΊ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ!
ΠΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠ΅ΠΉ
ΠΠ±ΡΠΈΠ΅ ΠΊΠΎΠΌΠ°Π½Π΄Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΠΎΡΡΠ°Π»ΠΈΡΡ ΡΠ΅ΠΌΠΈ ΠΆΠ΅, ΡΡΠΎ ΠΈ Π² ΠΏΡΠ΅Π΄ΡΠ΄ΡΡΠΈΡ Π²Π΅ΡΡΠΈΡΡ :
yarn init β ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΏΡΠΎΠ΅ΠΊΡΠ°
[—dev] β Π΄ΠΎΠ±Π°Π²Π»Π΅Π½ΠΈΠ΅ ΠΏΠ°ΠΊΠ΅ΡΠ°
Π’Π°ΠΊΠΆΠ΅, Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΡΠ²ΠΈΠ΄Π΅ΡΡ Π½Π΅ΠΊΠΎΡΠΎΡΡΠ΅ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΊΠΎΠ½ΡΠΎΠ»ΡΠ½ΠΎΠ³ΠΎ ΠΈΠ½ΡΠ΅ΡΡΠ΅ΠΉΡΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π²Π΅ΡΡΠΈΠΈ Yarn:
ΠΊΠ°ΠΆΠ΄ΡΠΉ Π½Π°Π±ΠΎΡ ΡΠ²ΡΠ·Π°Π½Π½ΡΡ Π·Π°Π΄Π°Ρ, Π²ΡΠΏΠΎΠ»Π½ΡΠ΅ΠΌΡΡ Π² ΠΏΡΠΎΡΠ΅ΡΡΠ΅ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΠΈ, ΡΠ³ΡΡΠΏΠΏΠΈΡΠΎΠ²Π°Π½;
ΠΏΠΎΡΡΠΈ Π²ΡΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ ΠΈΠΌΠ΅ΡΡ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠ΅ ΠΊΠΎΠ΄Ρ ΠΎΡΠΈΠ±ΠΎΠΊ, ΠΊΠΎΡΠΎΡΡΠ΅ ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΠΉΡΠΈ Π² Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ;
ΡΠ²Π΅ΡΠ° ΡΠ΅ΠΏΠ΅ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΡΡΡΡ ΡΠΎΠ»ΡΠΊΠΎ Π΄Π»Ρ ΠΎΠ±ΠΎΠ·Π½Π°ΡΠ΅Π½ΠΈΡ Π²Π°ΠΆΠ½ΡΡ ΡΠ°ΡΡΠ΅ΠΉ ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ.
Π£ΡΡΠ°Π½ΠΎΠ²ΠΊΠ° React.js Ρ Yarn-ΠΏΠ»Π°Π³ΠΈΠ½ΠΎΠΌ TypeScript
ΠΠ°Π»Π΅ΠΊΠΎ Π½Π΅ Π²ΡΠ΅ ΠΏΠ°ΠΊΠ΅ΡΡ ΠΏΠΎΡΡΠ°Π²Π»ΡΡΡΡΡ Ρ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠΌΠΈ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡΠΌΠΈ ΡΠΈΠΏΠΎΠ², Π½ΠΎ ΡΠΆΠ΅ Π½Π΅Ρ ΠΏΠΎΠ²ΠΎΠ΄ΠΎΠ² Π΄Π»Ρ Π²ΠΎΠ»Π½Π΅Π½ΠΈΡ, Π²Π΅Π΄Ρ ΡΠ°ΠΌ, Π³Π΄Π΅ ΠΈΡ Π½Π΅Ρ, Yarn Π²ΠΎΠ·ΡΠΌΡΡ ΡΠ°Π±ΠΎΡΡ Π½Π° ΡΠ΅Π±Ρ.
ΠΠ΅ΡΠ΅Π΄ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΠ΅ΠΌ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠ΅ΠΉ Π½ΠΈΠΆΠ΅, ΡΠ»Π΅Π΄ΡΠ΅Ρ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ Yarn Berry Π΄Π»Ρ ΡΠ°Π±ΠΎΡΠ΅ΠΉ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ ΠΈ ΡΠ±ΡΠ°ΡΡ Π΄Π΅ΡΠ΅ΠΉ ΠΎΡ ΡΠΊΡΠ°Π½Π°.
ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅ΠΌ package.json ΠΈ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΠΌ ΠΏΠ»Π°Π³ΠΈΠ½ TypeScript:
ΠΡΠΎΠ²Π΅Π΄Π΅ΠΌ ΡΡΡΠ°Π½ΠΎΠ²ΠΊΡ Π±ΠΈΠ±Π»ΠΈΠΎΡΠ΅ΠΊΠΈ React:
ΠΠ°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ @types/ Π±ΡΠ»ΠΈ ΡΡΠΏΠ΅ΡΠ½ΠΎ ΡΡΡΠ°Π½ΠΎΠ²Π»Π΅Π½Ρ!
package.json
Π§ΡΠΎ Π² ΠΈΡΠΎΠ³Π΅
ΠΠ΅ΡΠΊΠ° Yarn 1.x (Classic) ΡΠΆΠ΅ ΠΎΡΠΈΡΠΈΠ°Π»ΡΠ½ΠΎ ΠΏΠ΅ΡΠ΅ΡΠ»Π° Π² ΡΡΠ°ΡΡΡ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΈ, ΠΏΡΠ΅Π΄ΠΏΠΎΠ»Π°Π³Π°ΡΡΠ΅ΠΉ ΡΠΎΠ»ΡΠΊΠΎ ΠΈΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΡΡΠ·Π²ΠΈΠΌΠΎΡΡΠ΅ΠΉ.
ΠΠ»Ρ React Native Π²ΡΡ ΡΠ°ΠΊΠΈ ΠΏΡΠΈΠ΄ΡΡΡΡ ΠΏΠΎΠ΄ΠΊΠ»ΡΡΠ°ΡΡ node modules.
ΠΡΠ»ΠΈ Yarn Π½Π΅ ΠΏΠΎΠ΄ΡΡΠΆΠΈΡΡΡ Ρ Π²Π°ΡΠ΅ΠΉ IDE, Π½ΡΠΆΠ½ΠΎ Π±ΡΠ΄Π΅Ρ ΠΊΠΎΠ΅-ΡΡΠΎ ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ. ΠΠ΅ ΡΠΊΡΡΠ°ΠΉΡΠ΅!
Installation
Install via npm
It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system.
Once you have npm installed you can run the following both to install and upgrade Yarn:
Alternatives
Alpine
On Alpine Linux (3.6+), you can install Yarn with apk.
Currently, there are no Alpine packages available for RC or nightly builds of Yarn. Please use the tarball:
Installation Script
One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal:
The installation process includes verifying a GPG signature. View the source on GitHub
You can also specify a version by running the following code in your terminal:
See the releases for possible versions.
Manual Install via tarball
You can install Yarn by downloading a tarball and extracting it anywhere.
Before extracting Yarn, it is recommended that you verify the tarball using GPG:
Path Setup
If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere.
Arch Linux
On Arch Linux, Yarn can be installed through the official package manager.
Currently, there are no Arch packages available for RC or nightly builds of Yarn. Please use the tarball:
Installation Script
One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal:
The installation process includes verifying a GPG signature. View the source on GitHub
You can also specify a version by running the following code in your terminal:
See the releases for possible versions.
Manual Install via tarball
You can install Yarn by downloading a tarball and extracting it anywhere.
Before extracting Yarn, it is recommended that you verify the tarball using GPG:
Path Setup
If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere.
CentOS / Fedora / RHEL
On CentOS, Fedora and RHEL, you can install Yarn via our RPM package repository.
If you do not already have Node.js installed, you should also configure the NodeSource repository:
Then you can simply:
Currently, there are no RPM packages available for RC or nightly builds of Yarn. Please use the tarball:
Installation Script
One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal:
The installation process includes verifying a GPG signature. View the source on GitHub
You can also specify a version by running the following code in your terminal:
See the releases for possible versions.
Manual Install via tarball
You can install Yarn by downloading a tarball and extracting it anywhere.
Before extracting Yarn, it is recommended that you verify the tarball using GPG:
Path Setup
If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere.
Debian / Ubuntu
On Debian or Ubuntu Linux, you can install Yarn via our Debian package repository. You will first need to configure the repository:
On Ubuntu 16.04 or below and Debian Stable, you will also need to configure the NodeSource repository to get a new enough version of Node.js.
Then you can simply:
If using nvm you can avoid the node installation by doing:
Path Setup
If Yarn is not found in your PATH, follow these steps to add it and allow it to be run from anywhere.
Gentoo Linux
On Gentoo Linux, you can install Yarn with portage.
Currently, there are no Gentoo packages available for RC or nightly builds of Yarn. Please use the tarball:
Installation Script
One of the easiest ways to install Yarn on macOS and generic Unix environments is via our shell script. You can install Yarn by running the following code in your terminal: