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

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

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

<a href="http://www.jincon.com/tag/npm/" 
οnclick="javascript:tagshow('npm');return false;">npm</a> 
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

如图:


  • 9
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值