如何从纱线github回购安装包

当我使用npm install fancyapps/fancybox#v2.6.1 --save ,fancybox pkg在v2.6.1标签将被安装。 这种行为在文档中描述

我想问,如何用yarn做这个?

这个命令是否是正确的select? 在纱线文件是不是这个格式的任何东西。

yarn add fancyapps/fancybox#v2.6.1

 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. 

fancybox git版本不支持2.6.1

 yarn add https://github.com/fancyapps/fancybox [remote url] yarn add https://github.com/fancyapps/fancybox#3.0 [branch] yarn add https://github.com/fancyapps/fancybox#5cda5b529ce3fb6c167a55d42ee5a316e921d95f [commit] 

这在这里描述: https : //yarnpkg.com/en/docs/cli/add#toc-adding-dependencies

例如:

 yarn add https://github.com/novnc/noVNC.git#0613d18