2025
07
06
22
16
[nodejs] npm install 憑證問題
C:\>npm.cmd instal sqlite
npm error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm error errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm error request to https://registry.npmjs.org/sqlite failed, reason: unable to get local issuer certificate
npm error A complete log of this run can be found in: C:\Users\test\AppData\Local\npm-cache\_logs\2025-07-06T14_05_10_692Z-debug-0.log
解決方法是設定certificate file.
C:\>set NODE_EXTRA_CA_CERTS=c:\temp\ca.pem
或者是直接關掉certificate檢查.
C:\>set NODE_TLS_REJECT_UNAUTHORIZED=0
Ref: https://blog.darkthread.net/blog/npm-unable-get-local-issuer-cert-issue/