yarnpkg/yarn

Yarn add fails if package url should be fetched using "git config --global url"

Open

#2.614 geöffnet am 2. Feb. 2017

Auf GitHub ansehen
 (9 Kommentare) (12 Reaktionen) (0 zugewiesene Personen)JavaScript (41.514 Stars) (2.731 Forks)batch import
cat-featuregood first issuehelp wantedtriaged

Beschreibung

in a project i work in, the line in package.json of a dependancy is:

"some_package": "bitbucket:some_company/some_package#develop"

in an automated environment the following command runs before npm install:

git config --global url."https://x-token-auth:${access_token}@bitbucket.org/some_company/".insteadOf https://bitbucket.org/some_company/

now when running yarn install --verbose i see that yarn first tries to get git refs from the repository but it has no permissions, and fails with 401:

verbose Request "https://bitbucket.org/some_company/some_package.git" finished with status code 302.
verbose Performing "GET" request to "https://bitbucket.org/some_company/some_package.git/info/refs?service=git-upload-pack".
verbose Request "https://bitbucket.org/some_company/some_package.git/info/refs?service=git-upload-pack" finished with status code 401.
verbose Error: Error connecting to repository. Please, check the url.

maybe in case of 401, the repository should be fetched using GIT.

Contributor Guide