Package Managers
Last updated
Was this helpful?
Last updated
Was this helpful?
While you may be familiar with npm
, or even use it as your package manager of choice, it is not the recommended package manager for this project. This is because Yarn
is faster, more reliable, and more extensible than npm
. If you are not familiar with Yarn
, you can read more about it .
To download Yarn
using npm
, run the following command:
This will install Yarn Classic/v1
globally on your machine.
Yarn 3
includes a host of benefits over Yarn Classic/v1
, including:
Even faster installs
More verbose & readable output
Yarn version
is stored directly in the repo to keep everyone on the same version
Yarn plugins
can be added to extend the functionality of Yarn
PnP
(Plug and Play) mode can be used to improve performance and stability (if supported by your project)
Helpful, new commands like yarn dedupe
, yarn info
, & more
Yarn does not use
PnP
by default. If you would like to usePnP
, you can read more about it .
To upgrade to Yarn 3
from Yarn Classic/v1
, run the following command:
Now, you can start getting plugins to extend the functionality of Yarn 3
.
This will install the Yarn-TypeScript
plugin, which automatically adds @types/
packages into your dependencies when you add a package that doesn't include its own types
This will install the Interactive-Tools
plugin, which includes the yarn dedupe
& yarn upgrade-interactive
commands. These commands will help you to remove duplicate packages from your node_modules
folder, and upgrade your dependencies to the latest versions.
Read more about the differences between Yarn Classic/v1
and Yarn 3
.