Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yarn package manager: install dependencies from private Bitbucket repository

I'm trying to migrate a project from NPM to Yarn.

Part of my node dependencies are private packages hosted on Bitbucket (not published on NPM registry) under the namespace of the company I'm working for.

With NPM I'm able to declare those kind of dependencies with different syntaxes in my package.json. Like this:

// package.json

"dependencies": {
  ...
  @myCompany/package-name": "bitbucket:bitbucket-username/repo-name.git",
  ...
}

But when I run yarn install I the following error:

ssh: Could not resolve hostname bitbucket: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

I'm running yarn v0.23.3 on a MAC OSX.

Is there any further syntax or workaround to let yarn install private repository from bitbucket?

I've scraped into Yarn's github issues, but I wasn't able to find any hint to decide whether keep on trying or give up.

Thank in advance!

like image 529
Andrea Carraro Avatar asked Apr 30 '17 15:04

Andrea Carraro


2 Answers

Try

"@myCompany/package-name": "git+ssh://[email protected]/bitbucket-username/repo-name.git",

At least, that's what I'm using and it works without any problems.

like image 138
Creynders Avatar answered Nov 15 '22 23:11

Creynders


I didn't succeeded to know if this issue with yarn was resolved yet. So instead here is a workaround : https://www.npmjs.com/package/yarn-git-install

like image 35
Kuu Aku Avatar answered Nov 15 '22 21:11

Kuu Aku