Kas*_*eni 166
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.
Run Code Online (Sandbox Code Playgroud)
2.6.1在fancybox git版本中不可用
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]
Run Code Online (Sandbox Code Playgroud)
Ell*_*iot 60
Yarn 2从远程 URL 安装略有变化。具体来说,远程 URL 必须以包名称为前缀。所以对于 github 来说这意味着:
yarn add '<package name>@https://github.com/<github user>/<github repo>'
Run Code Online (Sandbox Code Playgroud)
确保它与存储库文件字段<package name>中的值匹配。"name"package.json
要定位特定分支,请添加head=<branch>或commit=<full commit hash>通过 URL 片段:
yarn add '<package name>@https://github.com/<github user>/<github repo>#head=<branch name>'
Run Code Online (Sandbox Code Playgroud)
如果您尝试从 github 上的 Yarn monorepo 安装单个包,您可以添加workspace=<package name>到 URL 片段:
yarn add '<package name>@https://github.com/<github user>/<github repo>#head=<branch name>&workspace=<package name>'
Run Code Online (Sandbox Code Playgroud)
Tyl*_*ler 18
对于ssh样式的url,只需在url之前添加ssh:
yarn add ssh://<whatever>@<xxx>#<branch,tag,commit>
Run Code Online (Sandbox Code Playgroud)
lan*_*wen 10
这在这里描述:https://yarnpkg.com/en/docs/cli/add#toc-adding-dependencies
例如:
yarn add https://github.com/novnc/noVNC.git#0613d18
Run Code Online (Sandbox Code Playgroud)
对于GitHub(或类似的)私有存储库:
yarn add 'ssh://git@github.com:myproject.git#<branch,tag,commit>'
npm install 'ssh://git@github.com:myproject.git#<branch,tag,commit>'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
57987 次 |
| 最近记录: |