Question: I'm trying to install a private package recently moved from github to bitbucket. 

```
npm install git@bitbucket.org:owner/repo.git

```

ends up with 

```
npm http GET https://registry.npmjs.org/git

```

(note package in the url) with this error:

> 
> npm ERR! notarget No compatible version found: git@'bitbucket.org:flyvictor/fortune-secruity.git'
> 
> 
> 

(note a `'` just after `@`)

I tried to escape @, wrap repo name in quotes, but always get same result. 

For github we use urls formatted as `git://github.com/owner/repo#v.v.v` and this works fine! But if I use same syntax for bitbucket npm just hangs doing nothing.

Any idea?

p.s. keys, access right and so one are correct. I can contribute to these repos, clone them with git, but not to npm install. Github packages that get installed well are also private.

Answer: 
**Declaimer:** As Eric Uldall said: this method is easy but it lacks security. You have now committed a password in plain text to your repository. That's how is working out lately for me, but not recommended.

---

Straight from the [npm Documentation](https://docs.npmjs.com/cli/install.html) for the `install` command:

```
$ npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]

```

Example: 

```
$ npm install bitbucket:mybitbucketuser/myproject

```

The [Yarn documentation](https://yarnpkg.com/en/docs/cli/add) for `add` as of today Feb 28, 2019 doesn't have support for git repositories.

The above example didn't work for me with private repositories, because you will need to generate a token to use it. How is that?

Login to your Bitbucket account and under user settings add an app password:

[![img](https://i.stack.imgur.com/3QUmS.png)](https://i.stack.imgur.com/3QUmS.png)

Then you can add the dependency to your `package.json` as:

```
"dependencies": {
    "module": "git+https://<username>:<app-password>@bitbucket.org/<owner>/<repo>.git"
}

```

or on your terminal type:

```
npm install git+https://<username>:<app-password>@bitbucket.org/<repo-owner>/<repo>.git

```

Don't forget to replace:

* **username**: with your username
* **password**: with your app password
* **repo-owner**: with the owner of the repo
* **repo**: with the repository name of the module
So in order to install npm package from remote git repository, you need to make sure

* You have git binary installed in your machine/virtual machine/container you're working on
* You have access to the repo, and I recommend you to use https instead of ssh for the protocol for the public repo because ssh protocol requires you to have ssh credentials.