Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Private bitbucket repository in package.json with version

I am trying to include a private BitBucket repository to my package.json, but I also would like to manage the version, as a normal module. currently I am using this

"package-name": "git+https://<user>:<password>@<url-repository>.git" 

I already tried it, but it didn't work.

"package-name": "git+https://<user>:<password>@<url-repository>.git#v1.0" 

Any idea?

like image 504
Kelyane Avatar asked May 10 '17 15:05

Kelyane


People also ask

How do I access private Bitbucket repository?

A private Git repository on Bitbucket can be accessed using either SSH or HTTPS. The preferred method is to always use SSH and a SSH key pair. Only use HTTPS if you have no choice.

What does private in package json mean?

private. If you set "private": true in your package. json, then npm will refuse to publish it. This is a way to prevent accidental publication of private repositories. Follow this answer to receive notifications.


1 Answers

  1. Login to your bitbucket account and under user settings add an app password:

    > https://bitbucket.org/account/user/{yourUsername}/app-passwords

  2. Add package dependency to your package.json as:

"dependencies": { "my-module": "git+https://Xaqron:[email protected]/Xaqron/my-module.git#*" } 

Replace Xaqron with your own username and pwd with app password from step one.

to install specific version add #v.v.v (i.e. #1.0.0) to the end of dependency URL.

like image 93
Xaqron Avatar answered Sep 21 '22 09:09

Xaqron