[英]Can't install ssh2 node module
I try to install ssh2 from https://github.com/mscdex/ssh2 by issuing command sudo npm install ssh2. 我尝试通过发出命令sudo npm install ssh2从https://github.com/mscdex/ssh2安装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. 我正在使用nvm和节点v0.10.13,但在错误中表明我当前正在使用节点v0.6.19。
node -v
v0.10.13
What happen? 发生什么事?
不使用sudo尝试: npm install ssh2
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. 是的,错误是ssh2需要节点
>=0.8.7
并且您的PATH和/或nvm设置导致您执行在节点v0.6下运行的npm的旧版本。 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. 通过安装并正确执行具有完整文件系统路径而不只是
npm
的特定版本的npm来解决此问题,它将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.