Strictly Programming

npm install modules from bitbucket private repositories

Posted in Uncategorized by sqllyw on 10/17/2015

You might have private repositories in bitbucket and you declare dependencies in your nodejs app’s package.json:
"dependencies": {
"ejs": "1.0.0"

when you do a npm install, you will be prompted to enter password twice, after entering the password, installation will proceed, this might work or might not work at all.

A simple approach as follow:

1) turn on git cache, keep password in the cache for a certain period of time:
git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'
2) access the private repo once, answer password when prompted:
git ls-remote

now you can install packages:

npm install --production

or all
npm install
Tagged with: , ,

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: