首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误: UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap安装

错误: UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap安装
EN

Stack Overflow用户
提问于 2013-12-24 00:57:27
回答 6查看 106.3K关注 0票数 73

我正在尝试在Ubuntu中安装Phonegap。NodeJS安装成功,但是我不能安装Phonegap本身。以下是终端的错误输出:

代码语言:javascript
复制
test@test-VirtualBox:~$ sudo npm install -g phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/phonegap
npm http GET https://registry.npmjs.org/phonegap
npm ERR! Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR!     at SecurePair.<anonymous> (tls.js:1350:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:963:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:463:15)
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:219:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:209:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:573:24)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/test/npm-debug.log npm

npm ERR! System Linux 3.11.0-14-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "phonegap"
npm ERR! cwd /home/test
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/test/npm-debug.log
npm ERR! not ok code 0

任何帮助都将不胜感激。

EN

回答 6

Stack Overflow用户

发布于 2014-01-27 23:51:15

我收到了同样的错误,因为我在公司防火墙/代理服务器后面,并且我的连接被传递给了代理服务器的证书。

在命令行中运行:

代码语言:javascript
复制
npm config set strict-ssl false

注意:这不是盲目接受不受信任或无效的SSL证书的最佳实践,命令就是这样做的(关闭证书检查)。你可以运行

代码语言:javascript
复制
npm config set strict-ssl true

才能把它重新打开。

参考:https://thomashunter.name/blog/npm-ssl-errors/

票数 149
EN

Stack Overflow用户

发布于 2015-08-13 19:56:10

这个问题可以在不禁用严格SSL的情况下修复,但它不是微不足道的。

实际正在使用的证书,很可能你是behind a corporate SSL intercepting proxy。由于证书是通过组策略分发并导出为p7b文件,因此我最终在Windows中运行了certmgr.msc

转换证书如有必要,我使用openssl工具从p7b转换为(又名.crt)

代码语言:javascript
复制
openssl pkcs7 -print_certs -inform DER -in /mnt/adam/certs/my-company-root.p7b -outform PEM -out my-company-root.crt

如果有多个证书,请将合并到单个文件taking care to order from leaf to root.

代码语言:javascript
复制
cat my-company-leaf.crt my-company-intermediate.crt my-company-root.crt > my-company-single.crt

在证书文件中配置 npm

代码语言:javascript
复制
npm config set cafile my-company-single.crt

(或全局)

代码语言:javascript
复制
sudo npm config set -g cafile my-company-single.crt
票数 29
EN

Stack Overflow用户

发布于 2014-02-04 03:11:06

正在运行

代码语言:javascript
复制
npm config set strict-ssl false

解决了我的问题。

我使用的是Vagrant (Linux precise32 Ubuntu ),Windows7作为主机。

谢谢

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20747817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档