Tag Archives: npm

NPM install from branch on private repo

onedayitwillmake No Comments

Something you need a specific branch of a repository that has not been published yet.

git+http://git@SUBDOMAIN.DOMAIN.COM/USER/REPO-URL.git#4d331600

For example:

// this URL
https://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs/tree/39333c6227ea537e3f5d4ec9e893d7f9c670c867
 
// becomes in your package.json
git+https://git@github.com/USERNAME/REPO_NAME.git#39333c6227ea537e3f5d4ec9e893d7f9c670c867
 
// If that doesn't work, try:
npm install --save git+ssh://git@github.com/USERNAME/REPO_NAME.git#HASH

Swap HTTP for HTTPS, depending on your repo location