Bitbucket : How to npm install private dependencies repo



        Hi everyone, i'm started working with control version and dependency library included aws cloud services, this is the first time i've founded this issues i'm struggling with research who have an experience a kind of this with role member but you're working in company. That's me, with Bitbucket and npm.

        After try any solution i've found the correct way, don't use ssh or git as prefix of dependencies for npm install private dependencies from 3rd party like jenkins work with aws elastic beanstalk to deploy your new stuff. As i'm team member and i'm working under company's bitbucket. Here is the true form of npm install dependencies.

"dependencies": {
        "name": "https://user:password@bitbucket.org/company_name/repo_name.git#master
}

I'll explain what kind of each hi-light important part.

        user - this is refer to your login user of bitbucket, as username as below image, after login goto bottom, click gear icon or profile image > Bitbucket settings.


        password - stay in bitbucket account then under Access management, click App passwords, then click Create app password, then fill app name (any name not important) and check permission that you want to allow. I've suggest only read permission and be careful what you want to do.



When've decided, click Create and Bitbucket will generate password for you, Very Important!, please backup this password to where it's safe or send an email to yourself

        company_name - stay on bitbucket then goto your entire project and you will see the url, the company_name is placing between user and projects as below image.


        repo_name - stay on bitbucket and click to your repo that you've decided to use as dependencies require from other project, on the top-right click clone and you'll see your full path of your repo it's name.git, that's name you needed.


        master - this is the version control from branch name or tag as a number series like 1.0.0, but this is from master branch. After ready try to test install on locally by command line:

npm install https://user:password@bitbucket.org/company_name/repo_name.git#master 

if you can install without an error. So your dependencies can install and deploy through jenkins's pipeline to aws elastic beanstalk as you want. See you next thread ;)

No Like, No Thumbs Up, No Bell, Just support me by click ads, thank you...

Comments