Strider-CD / strider-node

Run Node.js tests in strider
11 stars 13 forks source link

Flow SSH context to NPM install command #11

Open howarddierking opened 9 years ago

howarddierking commented 9 years ago

In my Node project, I'm referencing another project (internally via it's github repository URL). My package.json file looks similar to the following:

{
  ...
  "dependencies": {
    "request": "^2.45.0",
    "underscore": "^1.7.0",
    "my-utils": "git+ssh://git@github.com:my/node-utils.git#dev"
  },
  ...
}
Everything starts working as expected, until npm tries to resolve the git-based dependency. Then I get the following error.

npm ERR! git clone git@github.com:my/node-utils.git Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-my-node-utils-git-3fdbd8e2'...
npm ERR! git clone git@github.com:my/node-utils.git Host key verification failed.
npm ERR! git clone git@github.com:my/node-utils.git fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:my/node-utils.git 
npm ERR! git clone git@github.com:my/node-utils.git Please make sure you have the correct access rights
npm ERR! git clone git@github.com:my/node-utils.git and the repository exists.
npm ERR! Error: Command failed: Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-my-node-utils-git-3fdbd8e2'...
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! 
npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:743:16)
npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:466:12)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/isaacs/npm/issues>

I had tried registering the public key from the project configuration on github, but it didn't have any effect on the error. I haven't yet tried putting in the details from my existing keys to those fields, but don't see how that would help given what I've observed thus far. Ideally, I would like to have the node plugin be aware of the SSH context used to clone the original project repo. This is especially helpful given the pain involved with setting up a private NPM registry.

thanks,

_howard

ghost commented 9 years ago

I've got this problem also, so I'd be into the same feature.