yarnpkg/yarn

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

Open

#2 614 ouverte le 2 févr. 2017

Voir sur GitHub
 (9 commentaires) (12 réactions) (0 assignés)JavaScript (2 731 forks)batch import
cat-featuregood first issuehelp wantedtriaged

Métriques du dépôt

Stars
 (41 514 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur