npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

npm install fails on stingray-plugin with git@github.com: Permission denied (publickey)

d:\Users\mbonk\git\repos\stingray-plugin>npm install
npm ERR! git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit at ChildProcess.exithandler (child_process.js:751:12)
npm WARN addRemoteGit at ChildProcess.emit (events.js:110:17)
npm WARN addRemoteGit at maybeClose (child_process.js:1015:16)
npm WARN addRemoteGit at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
2-git-88e6e085
npm ERR! git -c core.longpaths=true fetch -a origin
npm ERR! git fetch -a origin (git@github.com:mishoo/UglifyJS2.git) git@github.com: Permission denied (publickey).
npm ERR! Windows_NT 6.3.9600
npm ERR! argv “C:\Program Files (x86)\nodejs\\node.exe” “C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js” “install”
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true fetch -a origin
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!

What do I need to do to get this to work?


Does this problem happen with more recent versions of npm (and node)? Updating seems to fix it.


Yes, thanks.
After I managed to work out that I had an old node.js installation from which npm that was being picked up from and causing ‘npm install -g npm@latest’ to fail. This solved the problem.