通过npm安装节点模块时出错

时间:2013-11-27 10:54:29

标签: node.js npm node-modules

我正在尝试通过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 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!     <npm-@googlegroups.com>

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 个答案:

答案 0 :(得分:1)

尝试以这种方式安装它:

npm install ./redis-0.9.0.tgz