• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

172
Views
NPM install from github using a tag

I need to do a npm install into my angular2 project from git but using a tag which is tag = 6.0.0.

e.g.

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

How would I do the equivalent of :

  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:
about 3 years ago · Santiago Trujillo
3 answers
Answer question

0

NPM allows installation using commit-ish tags on GitHub:

npm install <git remote url>

for example:

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

Note that you need to specify the protocol in the url, e.g. git+https://.

Documentation: https://docs.npmjs.com/cli/install

about 3 years ago · Santiago Trujillo Report

0

Another option from the npm docs:

As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-project". Just as with git URLs, a commit-ish suffix can be included.

These 2 commands install the same tag v0.6.0-0 of the akveo/ng2-smart-table github repo (tested npm version 5.4.2)

npm install akveo/ng2-smart-table#v0.6.0-0

npm install github:akveo/ng2-smart-table#v0.6.0-0

about 3 years ago · Santiago Trujillo Report

0

As explained above how to install the repository via NPM here is some extra info to complete the above answer.

If you don't want to worry about the protocol meaning that you don't want to change the URL from the original URL you can set the URL re-writing in the following format:

git config --global url."https://".insteadOf git://
about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error