How to install npm package from bitbucket private repository



  • I build a npm package for my future projects , but i don't know how to install that package from bitbucket , please tell me the process.


  • Linux Help

    Declare dependencies in your nodejs app package.json:

    "dependencies": {
       "modulename":"git+https://[email protected]/lanakdevelopers/modulename.git",
       "ejs": "1.0.0"
    }
    

    Then follow below steps

    • 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'
    
    • Access your private repository once, type your bitbucket password when prompted
    git ls-remote https://[email protected]/lankadevelopers/modulename.git
    

    Now you can install packages using npm install


Log in to reply