2013-11-27 103 views
0

我想通过npm在本地安装节点模块redis v0.9.0。我从https://registry.npmjs.org/redis/-/redis-0.9.0.tgz下载了tgz文件。现在,当我尝试执行命令npm install redis-0.9.0.tgz时,它试图从存储库中再次下载,而不是仅仅解压缩和安装。我正在尝试在Linux环境下的命令。我不明白为什么它会尝试下载。通过npm安装节点模块时出错

npm http GET https://registry.npmjs.org/redis-0.9.0.tgz 
npm http GET https://registry.npmjs.org/redis-0.9.0.tgz 
npm http GET https://registry.npmjs.org/redis-0.9.0.tgz 
npm ERR! Error: DEPTH_ZERO_SELF_SIGNED_CERT 
npm ERR!  at SecurePair.<anonymous> (tls.js:1283:32) 
npm ERR!  at SecurePair.EventEmitter.emit (events.js:92:17) 
npm ERR!  at SecurePair.maybeInitFinished (tls.js:896:10) 
npm ERR!  at CleartextStream.read [as _read] (tls.js:430:15) 
npm ERR!  at CleartextStream.Readable.read (_stream_readable.js:320:10) 
npm ERR!  at EncryptedStream.write [as _write] (tls.js:344:25) 
npm ERR!  at doWrite (_stream_writable.js:219:10) 
npm ERR!  at writeOrBuffer (_stream_writable.js:209:5) 
npm ERR!  at EncryptedStream.Writable.write (_stream_writable.js:180:11) 
npm ERR!  at write (_stream_readable.js:573:24) 
npm ERR! If you need help, you may report this log at: 
npm ERR!  <http://github.com/isaacs/npm/issues> 
npm ERR! or email it to: 
npm ERR!  <[email protected]> 

npm ERR! System Linux 2.6.32-220.13.1.el6.x86_64 
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "redis-0.9.0.tgz" 
npm ERR! cwd /home/abc/download 
npm ERR! node -v v0.10.6 
npm ERR! npm -v 1.2.18 
npm ERR! 
npm ERR! Additional logging details can be found in: 
npm ERR!  /home/abc/download/npm-debug.log 
npm ERR! not ok code 0 

回答

1

尝试安装它以这样的方式

npm install ./redis-0.9.0.tgz 
+0

的区别是什么,它使得当我们用'/'? – user850234

+0

只要确保您从当前目录中读取 –

+0

我无法理解的一点是,以前我能够使用命令“npm install redis-0.9.0.tgz”进行安装,但并未尝试下载。但是现在为什么同一个命令不是突然工作,而是试图下载。任何想法可能是什么原因呢? – user850234