错误:UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap 安装 [英] Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap Installation

查看:24
本文介绍了错误:UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Ubuntu 中安装 Phonegap.NodeJS安装成功,但是Phonegap本身无法安装.这是终端的错误输出:

I'm trying to install Phonegap in Ubuntu. The installation of NodeJS was successful, however I can't install Phonegap itself. Here is the error output of terminal:

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

任何帮助将不胜感激.

推荐答案

我遇到了同样的错误,因为我在公司防火墙/代理后面,并且我的连接通过了代理的证书.

I got the same error, given I was behind a corporate firewall/proxy and my connection was passed the proxy's certificate.

在您的命令行中运行:

npm config set strict-ssl false

注意:这不是盲目接受不受信任或无效的 SSL 证书的最佳做法,这正是该命令所做的(关闭证书检查).你可以运行

NOTE: that this is not best practice to blindly accept untrusted or invalid SSL certificates, which is what the command does (turn off certificate checking). You can run

npm config set strict-ssl true

重新打开它.

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

这篇关于错误:UNABLE_TO_VERIFY_LEAF_SIGNATURE Phonegap 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆