我需要从 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/