当我使用时npm install fancyapps/fancybox#v2.6.1 --save,将安装位于v2.6.1标签的fancybox软件包。docs中描述了此行为
npm install fancyapps/fancybox#v2.6.1 --save
我想问一下,该怎么做yarn?
yarn
此命令是正确的选择吗?在yarn文档中,与这种格式无关。
yarn add fancyapps/fancybox#v2.6.1
您可以yarn通过指定远程URL(HTTPS或SSH)将任何Git存储库(或tarball)添加为依赖项:
yarn add <git remote url> installs a package from a remote git repository. yarn add <git remote url>#<branch/commit/tag> installs a package from a remote git repository at specific git branch, git commit or git tag. yarn add https://my-project.org/package.tgz installs a package from a remote gzipped tarball.
这里有些例子:
yarn add https://github.com/fancyapps/fancybox [remote url] yarn add ssh://github.com/fancyapps/fancybox#3.0 [branch] yarn add https://github.com/fancyapps/fancybox#5cda5b529ce3fb6c167a55d42ee5a316e921d95f [commit]
(注意:Fancybox v2.6.1在Git版本中不可用。)