如何检查证书链和自签名证书?

时间:2020-09-16 17:32:57

标签: npm

在我的项目中

npm install @angular/compiler-cli@">=9.0.0 <10" --dry-run
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning SELF_SIGNED_CERT_IN_CHAIN: request to https://registry.npmjs.org/@angular%2fcompiler-cli failed, reason: self signed certificate in certificate chain
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\@angular\compiler-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\afeldstein01\AppData\Roaming\npm-cache\_logs\2020-09-01T16_10_33_062Z-debug.log

是的,我的大部分帖子都是(格式为)代码。那是因为整个问题都包含在标题中。因此,我正在写这些不必要的单词,以便StackOverflow允许我发布问题。

1 个答案:

答案 0 :(得分:0)

在命令下运行。设置变量值。然后再试一次

export NODE_EXTRA_CA_CERTS="/absolute/path/to/self-signed-certificate.crt"