It's because you're running with sudo. You should see the same thing if you run your regular clone with sudo.
Your options are to set up your key to work with sudo, or don't use it when cloning/installing (better option). This isn't an npm bug at all, fwiw. On Monday, July 8, 2013, Maxim Yefremov wrote: > I try setup git dependencies in package.json: > > "dependencies": { > "myLib": "git+ssh://g...@domain.com:user/myLib.git" > } > > When I do sudo npm install I got errors: > > Warning: Permanently added the RSA host key for IP address 'myIp' to the list > of known hosts. > > Permission denied (publickey). > > Allthough I can clone successfully the same lib to that machine: > > git clone g...@domain.com:user/myLib.git > > So I have valid ssh keys. > > My os is *OsX* but I have the same problem on *linux*. Git repository is > bitbucked, but on github have the same problem. > > -- > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to > nodejs@googlegroups.com<javascript:_e({}, 'cvml', 'nodejs@googlegroups.com');> > To unsubscribe from this group, send email to > nodejs+unsubscr...@googlegroups.com <javascript:_e({}, 'cvml', > 'nodejs%2bunsubscr...@googlegroups.com');> > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "nodejs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to nodejs+unsubscr...@googlegroups.com <javascript:_e({}, 'cvml', > 'nodejs%2bunsubscr...@googlegroups.com');>. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.