Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM git dependency's not installing #295

Closed
corbinu opened this issue Jan 12, 2015 · 11 comments
Closed

NPM git dependency's not installing #295

corbinu opened this issue Jan 12, 2015 · 11 comments
Milestone

Comments

@corbinu
Copy link

corbinu commented Jan 12, 2015

Not sure if this is an NPM issue, but after installing the io.js nightly I am unable to install git dependancies. If this is an NPM issue I can log it there.

I was previously using
NPM 2.2.0
Node 0.12

On OS X 10.10

For example using this package.json

{
    "dependencies": {
        "async": "git+ssh://[email protected]:caolan/async.git#master"
    }
}

gives this error

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 warn package.json @ No description
6 warn package.json @ No repository field.
7 warn package.json @ No README data
8 verbose install where, deps [ '/Users/corbinu/Desktop', [ 'async' ] ]
9 verbose install where, peers [ '/Users/corbinu/Desktop', [] ]
10 info preinstall @
11 silly cache add args [ 'async@git+ssh://[email protected]:caolan/async.git#master',
11 silly cache add   null ]
12 verbose cache add spec async@git+ssh://[email protected]:caolan/async.git#master
13 silly cache add parsed spec { raw: 'async@git+ssh://[email protected]:caolan/async.git#master',
13 silly cache add   scope: null,
13 silly cache add   name: 'async',
13 silly cache add   rawSpec: 'git+ssh://[email protected]:caolan/async.git#master',
13 silly cache add   spec: 'ssh://[email protected]:caolan/async.git#master',
13 silly cache add   type: 'git' }
14 verbose addRemoteGit u="ssh://[email protected]:caolan/async.git#master" silent=false
15 silly addRemoteGit normalized { url: 'ssh://[email protected]:caolan/async.git',
15 silly addRemoteGit   branch: 'master' }
16 silly addRemoteGit v ssh-git-jackfan.us.kg-caolan-async-git-bea77bff
17 verbose addRemoteGit /Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff not in flight; cloning
18 info git [ 'clone',
18 info git   '--template=/Users/corbinu/.npm/_git-remotes/_templates',
18 info git   '--mirror',
18 info git   'ssh://[email protected]:caolan/async.git',
18 info git   '/Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff' ]
19 error git clone ssh://[email protected]:caolan/async.git Cloning into bare repository '/Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff'...
19 error git clone ssh://[email protected]:caolan/async.git ERROR: Repository not found.
19 error git clone ssh://[email protected]:caolan/async.git fatal: Could not read from remote repository.
19 error git clone ssh://[email protected]:caolan/async.git
19 error git clone ssh://[email protected]:caolan/async.git Please make sure you have the correct access rights
19 error git clone ssh://[email protected]:caolan/async.git and the repository exists.
20 verbose stack Error: Command failed: git clone --template=/Users/corbinu/.npm/_git-remotes/_templates --mirror ssh://[email protected]:caolan/async.git /Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff
20 verbose stack Cloning into bare repository '/Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff'...
20 verbose stack ERROR: Repository not found.
20 verbose stack fatal: Could not read from remote repository.
20 verbose stack
20 verbose stack Please make sure you have the correct access rights
20 verbose stack and the repository exists.
20 verbose stack
20 verbose stack     at ChildProcess.exithandler (child_process.js:736:12)
20 verbose stack     at ChildProcess.emit (events.js:119:17)
20 verbose stack     at maybeClose (child_process.js:1000:16)
20 verbose stack     at Socket.<anonymous> (child_process.js:1168:11)
20 verbose stack     at Socket.emit (events.js:116:17)
20 verbose stack     at Pipe.close (net.js:477:12)
21 verbose cwd /Users/corbinu/Desktop
22 error Darwin 14.1.0
23 error argv "node" "/usr/local/bin/npm" "install"
24 error node v1.0.0-nightly201501111b8f37bb4d
25 error npm  v2.2.0
26 error code 128
27 error Command failed: git clone --template=/Users/corbinu/.npm/_git-remotes/_templates --mirror ssh://[email protected]:caolan/async.git /Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff
27 error Cloning into bare repository '/Users/corbinu/.npm/_git-remotes/ssh-git-jackfan.us.kg-caolan-async-git-bea77bff'...
27 error ERROR: Repository not found.
27 error fatal: Could not read from remote repository.
27 error
27 error Please make sure you have the correct access rights
27 error and the repository exists.
28 error If you need help, you may report this error at:
28 error     <http://github.com/npm/npm/issues>
29 verbose exit [ 1, true ]
@rvagg
Copy link
Member

rvagg commented Jan 12, 2015

/cc @othiym23

@evanlucas
Copy link
Contributor

It looks like the url parsing is a little off.

With node v0.10.35, the url.parse returns something like:

{ protocol: 'ssh:',
  slashes: true,
  auth: 'git',
  host: 'github.com',
  port: null,
  hostname: 'github.com',
  hash: null,
  search: '',
  query: {},
  pathname: '/<user>/<repo>',
  path: '/:<user>/<repo>',
  href: 'ssh://[email protected]/:<user>/<repo>' }

but with the latest nightly:

{ protocol: 'ssh:',
  slashes: true,
  auth: 'git',
  host: 'github.com:<user>',
  port: null,
  hostname: 'github.com:<user>',
  hash: null,
  search: '',
  query: {},
  pathname: '/<repo>',
  path: '/<repo>',
  href: 'ssh://[email protected]:<user>/<repo>' }

Looks like it may have been introduced in c90eac7

@rvagg
Copy link
Member

rvagg commented Jan 12, 2015

@evanlucas if you're sure that's the commit could you cc the author into this thread?

@evanlucas
Copy link
Contributor

/cc @jondavidjohn

@corbinu
Copy link
Author

corbinu commented Jan 12, 2015

I tried rolling back that commit and building but still have the same issue

@evanlucas
Copy link
Contributor

ah, sorry, looks like 6120472 was the original

@evanlucas
Copy link
Contributor

After looking further into it, it looks like d312b6d#diff-bbc5176adff1bbc01acd61bfc85d049fR407 made a change that will also prevent npm from installing git dependencies as prior to that commit, pathname was not being set to this.path

@rvagg rvagg added this to the v1.0.0 milestone Jan 12, 2015
@rvagg rvagg mentioned this issue Jan 12, 2015
14 tasks
@bnoordhuis
Copy link
Member

#299 has landed but npm install "git+ssh://[email protected]:caolan/async.git#master" still doesn't work because of d312b6d. I'm going to prepare a revert of that commit. Anyone who knows of a better solution, please speak up now.

bnoordhuis added a commit to bnoordhuis/io.js that referenced this issue Jan 12, 2015
This reverts commit d312b6d.

Reverted for breaking `npm install` with git+ssh URLs.

Conflicts:
    doc/api/url.markdown

Fixes: nodejs#295
PR-URL: nodejs#303
Reviewed-By: Rod Vagg <[email protected]>
@bnoordhuis
Copy link
Member

This should be fixed by commits a1e54d6 and 913addb. Thanks for the bug report, @corbinu, and thanks @evanlucas for helping out.

@corbinu
Copy link
Author

corbinu commented Jan 12, 2015

Thanks so much guys. Working for me. Will keep testing. Can't wait for the release

@qingyuansihai
Copy link

i've ever meet this issue

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

No branches or pull requests

5 participants