git - 使用标签从 github 安装 NPM

标签 git angular github npm

我需要从 git 将 npm 安装到我的 angular2 项目中,但使用 tag = 6.0.0 的标签。

例如

git git@github.com:akveo/ng2-smart-table.git
cd ng2-smart-table
git checkout tags/v0.6.0-0

我将如何做相当于:
  npm install --save PACKAGE_NAME




npm install git@github.com:akveo/ng2-smart-table.git#v0.6.0-0 
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/node/6.5.0/bin/node" "/usr/local/bin/npm" "install" "git@github.com:akveo/ng2-smart-table.git#v0.6.0-0"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8

npm ERR! Unsupported URL Type: github.com:akveo/ng2-smart-table.git#v0.6.0-0
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:

最佳答案

NPM 允许使用 commit-ish 进行安装GitHub 上的标签:
npm install <git remote url>
例如:

npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
npm install git+https://isaacs@github.com/npm/npm.git
npm install git://github.com/npm/npm.git#v1.0.27

请注意,您需要在 url 中指定协议(protocol),例如git+https:// .

文档:https://docs.npmjs.com/cli/install

关于git - 使用标签从 github 安装 NPM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43252081/

相关文章:

git - 没有什么可以比较的。没有什么可比较的,分支是完全不同的提交历史

git - 获取标签的哈希值

git - 使用 git/bitbucket 突然开始收到 ssh_exchange_identification 错误

Git、Github、修复提交历史记录

github - 考虑到有冲突的存储库,如何在 GitHub 上正确显示 Python 包的依赖项?

Git merge 错误

javascript - 系统配置 defaultExtension 不适用于 Django

angular - 在 Angular 2中,没有检测到 `bs-config.json`或 `bs-config.js`覆盖文件。使用精简服务器默认值?

angular - ChangeDetectionStrategy.OnPush 不符合我的预期

GitHub Actions ***NO_CI*** 替代方案