For my new project, when use the yarn command for managing JavaScript packages. Its necessary to add a very specific version of that particular package from the GitHub or Bitbucket repository. The below steps are to know you how to add a package from the repository using YARN. The commands are very useful to find it.
To add yarn package from GitHub, you need to use this command:
To add yarn package from the GitHub or Bitbucket we need to use a command below,
yarn add <GitHub user_name>/<GitHub repository_name>
If you would like to add in a specific branch or commit, we need to use a command below,
yarn add <GitHub user_name>/<GitHub repository_name>#<branch/commit/tag>
Adn also you can add very specific version of the package, will use an option --exact or -E installs the packages as exact versions. The default is to use the most recent release with the same major version
yarn add <package_name>@<package_version> --exact
Comments (0)