当我试图安装软件包时,会发生此错误。
我的节点版本- 8.11.3。
npm - 5.6.0.
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz
npm WARN retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR! fetch failed https://registry.npmjs.org/async/-/async-0.2.6.tgz
npm WARN retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz
npm WARN retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR! fetch failed https://registry.npmjs.org/async/-/async-0.2.6.tgz
npm WARN retry will retry, error on last attempt: Error: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/async/-/async-0.2.6.tgz
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\Pawel\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\Pawel\\AppData\\Local\\atom\\app-1.30.0\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\Pawel\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\Pawel\\.atom\\.apmrc" "install" "C:\\Users\\Pawel\\AppData\\Local\\Temp\\d-11881-6496-2xm5hl.fyhtcsor\\package.tgz" "--runtime=electron" "--target=2.0.5" "--arch=ia32" "--global-style"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Pawel\AppData\Local\Temp\apm-install-dir-11881-6496-1hnnd3v.aeg4xwdn29\npm-debug.log
编辑:
我将minimatch更新为3.0.4,这并不能解决问题。
发布于 2018-09-01 14:39:04
早期的中断涉及DNS配置错误,导致一些ISP缓存npmjs.com丢失,解决办法是使用第三方DNS提供程序,如Cloudflare或Google,受影响的缓存应该在今后24小时内清除。
解决办法是修改主机文件:
使用不同的公共DNS提供程序(如Google或CloudFlare)的另一种方法是查找www.npmjs.com的IP地址,并将其添加到主机文件中:
请注意:为了避免已解决的IP地址更改的问题,我们强烈建议您在周末后将此条目从主机文件中删除。
解决方案的说明和更详细的描述列在npm网站上。
https://stackoverflow.com/questions/52128817
复制相似问题