Try without sudo: npm install ssh2
Can't install ssh2 node module
Pregunta
I try to install ssh2 from https://github.com/mscdex/ssh2 by issuing command sudo npm install ssh2. But it shows errors as follows:
ERR! Error: No compatible version found: ssh2
ERR! No valid targets found.
ERR! Perhaps not compatible with your version of node?
ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
ERR! at next (/usr/share/npm/lib/cache.js:415:44)
ERR! at /usr/share/npm/lib/cache.js:408:5
ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
ERR! You may report this log at:
ERR! <http://bugs.debian.org/npm>
ERR! or use
ERR! reportbug --attach /home/iwan/dev/workspace-nodejs/db-backup/npm-debug.log npm
ERR!
ERR! System Linux 3.8.0-26-generic
ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "ssh2"
ERR! cwd /home/iwan/dev/workspace-nodejs/db-backup
ERR! node -v v0.6.19
ERR! npm -v 1.1.4
ERR! message No compatible version found: ssh2
ERR! message No valid targets found.
ERR! message Perhaps not compatible with your version of node?
verbose exit [ 1, true ]
I am using nvm and node v0.10.13, but in the error it shows that i'm currently using node v0.6.19.
node -v
v0.10.13
What happen?
Solución
Otros consejos
Yes, the error is that ssh2 requires node >=0.8.7
and your PATH and/or nvm setup is causing you to execute an old version of npm running under node v0.6. That is definitely the problem. Fix it by installing and correctly executing a specific version of npm with a full filesystem path instead of just npm
and it will work.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow