nodejs的npm安装模块时候报错:npm ERR! Error: CERT_NOT_YET_VALID的解决方法

nodejs我就不介绍了,牛逼的东东,他非常强大。最近在centos6.4简化版的安装了node最新版,但是执行:

 npm install -g supervisor
竟然报错:
[root@localhost ~]# npm install -g supervisor
npm http GET https://registry.npmjs.org/supervisor
npm http GET https://registry.npmjs.org/supervisor
npm http GET https://registry.npmjs.org/supervisor
npm ERR! Error: CERT_NOT_YET_VALID
npm ERR!     at SecurePair.<anonymous> (tls.js:1370:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:469:13)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:226:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:216:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR!     at write (_stream_readable.js:583:24)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 2.6.32-431.5.1.el6.x86_64
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "supe   rvisor"
npm ERR! cwd /root
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /root/npm-debug.log
npm ERR! not ok code 0
经过仔细排查和google,原来是ssl 的问题:

解决办法:

 npm config set strict-ssl false
然后就OK啦~~~
npm install -g supervisor

如图:


npm.png

npm.png

大小: 9.68 KB
尺寸: 500 x 158
浏览: 35 次
点击打开新窗口浏览全图

关键词: npm , nodejs

上一篇: nginx通过nginx.conf配置文件防止SQL注入漏洞和远程文件包含攻击
下一篇: openssl心血(HeartBleed) 漏洞的检查和修复方法

目前还没有人评论,您发表点看法?
发表评论

评论内容 (必填):