yarnpkg/yarn

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

Open

#2,614 opened on Feb 2, 2017

View on GitHub
 (9 comments) (12 reactions) (0 assignees)JavaScript (41,514 stars) (2,731 forks)batch import
cat-featuregood first issuehelp wantedtriaged

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.

Contributor guide

Yarn add fails if package url should be fetched using "git config --global url" · yarnpkg/yarn#2614 | Good First Issue