架构游戏引擎node时遇到问题
发布于 9 年前 作者 davidg0 3795 次浏览 最后一次编辑是 8 年前 来自 问答

就是 npm install grunt-cli -g时出现如下错误:

33 error Error: CERT_NOT_YET_VALID
33 error at SecurePair.<anonymous> (tls.js:1367:32)
33 error at SecurePair.emit (events.js:92:17)
33 error at SecurePair.maybeInitFinished (tls.js:979:10)
33 error at CleartextStream.read [as _read] (tls.js:471:13)
33 error at CleartextStream.Readable.read (_stream_readable.js:340:10)
33 error at EncryptedStream.write [as _write] (tls.js:368:25)
33 error at doWrite (_stream_writable.js:225:10)
33 error at writeOrBuffer (_stream_writable.js:215:5)
33 error at EncryptedStream.Writable.write (_stream_writable.js:182:11)
33 error at write (_stream_readable.js:601:24)
33 error at flow (_stream_readable.js:610:7)
33 error at Socket.pipeOnReadable (_stream_readable.js:642:5)
34 error If you need help, you may report this *entire* log,
34 error including the npm and node versions, at:
34 error <http://github.com/npm/npm/issues>
35 error System Darwin 13.4.0
36 error command "node" "/usr/local/bin/npm" "install" "grunt-cli" "-g"
37 error cwd /Applications/MAMP/htdocs/gorescript-master
38 error node -v v0.10.30
39 error npm -v 1.4.21

然后终端不认grunt命令!

9 回复

证书问题啊,搜 npm Error: CERT_NOT_YET_VALID 就好了吧

看你这情况是不是用了代理了?然后没导入证书? 自豪地采用 CNodeJS ionic

@gloomyzerg 请问如何导入证书?

你用的是goagent吗?如果是他那个压缩包里面的local里面有个ca文件双击一下就可以导入 自豪地采用 CNodeJS ionic

@gloomyzerg 请问跟我目前在泰国有关吗?

这个应该是没啥关系吧,但是也不好说,dns要是解析的不对也有可能 自豪地采用 CNodeJS ionic

@gloomyzerg 我用的不是goagent, 好像都没有用代理

@davidg0 你这个确实是跟证书有关的错误 我以前用代理遇见过 我刚才查了一下 有的人说 跟时间设置也有关系 因为你现在在泰国 是不是你时区设置的不对 参考 http://stackoverflow.com/questions/23668148/npm-issue-cert-not-yet-valid-on-raspberry-pihttps://github.com/npm/npm/issues/2902 还有人给了个解决方案 http://www.jincon.com/archives/141/ 你试试 看你的是什么问题

@gloomyzerg 谢了,解决了

回到顶部