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

转自:http://www.jincon.com/archives/141/

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. (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!     

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

如图:

nodejs的npm安装模块时候报错:npm ERR! Error: CERT_NOT_YET_VALID的解决方法_第1张图片

你可能感兴趣的:(方法记录总结,nodejs,npm,报错)