Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

git+https urls don't seem to be honoured in 2.7.5 #7872

Closed
davetayls opened this issue Apr 7, 2015 · 15 comments
Closed

git+https urls don't seem to be honoured in 2.7.5 #7872

davetayls opened this issue Apr 7, 2015 · 15 comments

Comments

@davetayls
Copy link

My builds started breaking in 2.7.5 saying they don't have permission on private dependencies with the url structure:

git+https://user:[email protected]/team/repo.git

In the logs it looks like

npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror ssh://[email protected]/team/repo.git /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e
npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror ssh://[email protected]/team/repo.git /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e: Initialized empty Git repository in /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e/
npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror ssh://[email protected]/team/repo.git /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e: 
npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror ssh://[email protected]/team/repo.git /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e: Host key verification failed.
npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror ssh://[email protected]/team/repo.git /app/.npm/_git-remotes/ssh-git-bitbucket-org-team-repo-git-9307203e: fatal: The remote end hung up unexpectedly

It seems like it is not using the correct https url with the username and password.

I rolled back to using npm 2.5 and the issues went away

@kenany
Copy link
Contributor

kenany commented Apr 7, 2015

@davetayls Does this happen on [email protected] as well?

@kanongil
Copy link

kanongil commented Apr 7, 2015

I have a similar issue, which i can replicate on 2.7.6 as well. Note that I'm using the shrinkwrap feature, where it even though the url is directly specified in the package.json using git+https, it has recorded it as git+ssh in the shrinkwrap.

@davetayls
Copy link
Author

Hey. Sorry for the late reply, it went mental yesterday. I'm using the shrink wrap feature as well. I'll try the build with 2.7.6 this morning and feed back.

@cgreening
Copy link

Seeing this on heroku as well. Forced it to use the 2.7.6 version and it still fails.

@cgreening
Copy link

Rolled back npm to version 2.7.3 and it works fine, so I guess it's a problem introduced in 2.7.4

@davetayls
Copy link
Author

I'm finding it quite tricky to test this without causing an issue to the testers, i think it works locally because i have the correct ssh keys for the ssh url to work. seems @kanongil and @cgreening can replicate as well which is useful 👍 thanks

@vschoettke
Copy link

+1 Still a problem with [email protected]

@iarna
Copy link
Contributor

iarna commented Apr 11, 2015

This should be fixed in [email protected] (current npm@next). Could you verify that it works for you?

@cgreening
Copy link

Better, but it seems be missing the credentials that should be passed in the https url

 Npm version changed (2.7.3 => 2.8.0); invalidating cache
       Installing node modules
       npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror https://bitbucket.org/cgreening/noduleio.git /app/.npm/_git-remotes/https-bitbucket-org-cgreening-noduleio-git-5d0f1af7: Cloning into bare repository '/app/.npm/_git-remotes/https-bitbucket-org-cgreening-noduleio-git-5d0f1af7'...
       npm ERR! git clone --template=/app/.npm/_git-remotes/_templates --mirror https://bitbucket.org/cgreening/noduleio.git /app/.npm/_git-remotes/https-bitbucket-org-cgreening-noduleio-git-5d0f1af7: fatal: Authentication failed for 'https://bitbucket.org/cgreening/noduleio.git/'

In my package json the dependencies look like:

"noduleio": "git+https://cgreening:[email protected]/cgreening/noduleio.git"

@othiym23
Copy link
Contributor

This is one of the paths that I apparently didn't test enough – I can replicate that the credentials are getting stripped from the URLs and am working on a fix.

@othiym23
Copy link
Contributor

The fix for @cgreening's issue landed in 15efe12, and after banging on it some more, I'm confident that this is something that [email protected] (out very shortly) addresses.

@davetayls
Copy link
Author

Thanks very much :)

@cgreening
Copy link

Works on 2.8.1

Thanks!

@iMerica
Copy link

iMerica commented May 20, 2015

I'm still seeing this. What is the preferred way of downgrading npm to a specific version?

@kenany
Copy link
Contributor

kenany commented May 20, 2015

@iMerica What version are you still seeing this on? If you want to downgrade to, say, 2.7.3 for whatever reason:

$ npm install -g [email protected]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants