简体   繁体   English

Node.js 依赖项安装提供“证书链中的自签名证书”

[英]Node.js dependency installation giving "self signed certificate in certificate chain"

I am trying to install the dependency ursa package.我正在尝试安装依赖项ursa包。 But I get this error:但我收到此错误:

self signed certificate in certificate chain

Any idea on how to resolve this ?关于如何解决这个问题的任何想法?

I have set the correct proxy settings and was able to download the "node-horseman" dependency as well.我已经设置了正确的代理设置,并且能够下载“node-horseman”依赖项。

Any inputs will be much appreciated.任何输入将不胜感激。 Thanks in advance.提前致谢。

>node --version
v6.9.1
>npm install ursa
...\node_modules\ursa>if not defined npm_config_node_gyp (node "C:\Users
\xxxxxxxxxxx\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: self signed certificate in certificate chain
gyp ERR! stack     at Error (native)
gyp ERR! stack     at TLSSocket.<anonymous> (_tls_wrap.js:1062:38)
gyp ERR! stack     at emitNone (events.js:86:13)
gyp ERR! stack     at TLSSocket.emit (events.js:185:7)
gyp ERR! stack     at TLSSocket._finishInit (_tls_wrap.js:586:8)
gyp ERR! stack     at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\\\software\\node.exe" "C:\\Users\\xxxxxxxxxxx\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xxxxxxxxxxx\git\source_code_\ursa
gyp ERR! node -v v6.9.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN MobPhantom@1.0.0 No description
npm WARN MobPhantom@1.0.0 No repository field.

The workaround for this issue is to set the below as environment variable, 此问题的解决方法是将以下设置为环境变量,

NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_TLS_REJECT_UNAUTHORIZED = 0

Thanks. 谢谢。

Try uninstalling Angular/cli first and installing node-gyp and then try reinstalling Angular cli尝试先卸载 Angular/cli 并安装 node-gyp,然后尝试重新安装 Angular cli

npm uninstall -g @angular/cli
npm install -g node-gyp
npm install -g @angular/cli

It worked perfectly它工作得很好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 node.js elasticsearch 证书链中的自签名证书 - node.js elasticsearch self signed certificate in certificate chain 无法使用 Kubernetes 上的 Node.Js 连接到 Elasticsearch(证书链中的自签名证书) - Can't connect to Elasticsearch with Node.Js on Kubernetes (self signed certificate in certificate chain) ionic 3 / node.js - 证书链中的自签名证书(如何禁用strict-ssl?) - ionic 3 / node.js - Self signed certificate in certificate chain (how to disable strict-ssl?) 证书链中的自签名证书将node.js SDK用于Watson Assistant时出错 - Self signed certificate in certificate chain Error while using node.js SDK for watson assistant 错误:node.js 申请中证书链中的自签名证书 - Error: self signed certificate in certificate chain in node js application 节点JS REST调用错误:证书链中的自签名证书 - Node JS REST call Error: self signed certificate in certificate chain 证书链中的自签名证书 - Self signed certificate in certificate chain 在Node.JS中带有自签名证书的HTTPS代理 - HTTPS proxy with a self-signed certificate in Node.JS 无法将Node.js中的IP用于自签名证书 - Cannot use IP in Node.js for self-signed certificate 自签名证书Windows模拟器-node.js应用程序 - Self Signed Certificate Windows Emulator - node.js application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM