Kan*_*raj 5 npm reactjs react-native expo
request to https://registry.npmjs.org/expo-template-blank failed, reason: unable to get local issuer certificate
FetchError: request to https://registry.npmjs.org/expo-template-blank failed, reason: unable to get local issuer certificate
at ClientRequest. (C:\Users<username>\AppData\Roaming\npm\node_modules\expo-cli\node_modules\minipass-fetch\lib\index.js:97:14)
at ClientRequest.emit (events.js:210:5)
at TLSSocket.socketErrorListener (_http_client.js:406:9)
at TLSSocket.emit (events.js:215:7)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
有人有什么想法吗?
厌倦了以下步骤:
我遇到了同样的问题,但我支持公司代理。我假设设置 npm config setregistry http://registry.npmjs.org/没有帮助,并且 npm 客户端仍然通过 https 访问注册表。因此,我从 Mozilla Firefox 打开https://registry.npmjs.org/,单击锁定图标 -> 连接安全 -> 更多信息 -> 查看证书 在证书下,registry.npmjs.org 的右侧,我确实看到了我们的 Cisco 公司伞证书,因此来自杂项 -> 下载 PEM(链)
npm config set cafile <path_to_ca_file>\cacert.pem
现在将下载 PEM(链)的内容复制到 cacert.pem 文件的末尾。如果您还没有 cacert.pem,请使用下载的 PEM(链)文件作为 cacert.pem
同时创建一个环境变量 NODE_EXTRA_CA_CERTS 并将其指向相同的 cacert.pem: Windows:set NODE_EXTRA_CA_CERTS=<path_to_ca_file>\cacert.pem
Linux:导出 NODE_EXTRA_CA_CERTS=<ca_file 路径>/cacert.pem
现在尝试:导出 init MyFirstRNAApp
| 归档时间: | 
 | 
| 查看次数: | 2700 次 | 
| 最近记录: |