git+ssh installs write to the cache incorrectly in 1.5.0-alpha-4 #5752

Closed
Raynos opened this Issue Jul 22, 2014 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

Raynos commented Jul 22, 2014

When installing a dependency with a git+ssh uri it will be incorrectly installed into the npm cache.

cd ~/tmp
mkdir foo
cd foo
npm init
npm i git+ssh://git@github.com:Raynos/mercury.git --save
npm cache ls mercury # expect mercury in cache
cat ~/.npm/mercury/5.2.1/package/package.json | grep 'ssh://'
# expected _resolved to be git+ssh:// not ssh://
cat ./node_modules/mercury/packages | grep _resolved
# expected _resolved to be git+ssh:// not ssh://

The _resolved field in the cache is incorrectly truncated to ssh:// instead of git+ssh://.
It's also incorrectly truncated when installing into node_modules

This causes a bug where npm ls will say " Unsupported URL Type: ssh://"

When looking at install.js I see

I can confirm this bug.

@donaldpipowitch donaldpipowitch referenced this issue in uber/npm-shrinkwrap Jul 22, 2014

Closed

unsupported protocol ssh: #37

@othiym23 othiym23 added this to the 2.0.0 milestone Jul 23, 2014

@isaacs isaacs closed this in 6c47201 Aug 21, 2014

Contributor

Raynos commented Aug 21, 2014

@isaacs @othiym23 thanks :)

I'll try the new alpha this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment