问题描述

使用npm install安装模块的时候提示以下错误:

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

问题分析

出现这个问题的主要原因是strict-ssl配置的问题,禁用即可。

解决办法

npm config set strict-ssl false