gyp ERR! stack Error self signed certificate in certificate chain

August 11, 2021

gyp ERR! stack Error: self signed certificate in certificate chain 
gyp ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34) 
gyp ERR! stack at TLSSocket.emit (events.js:375:28) 
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:936:8) 
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12)

crt 인증서를 npm 세팅에 추가

명령어

npm config set cafile ~/[인증서].crt --global
export NODE_EXTRA_CA_CERTS=~/[인증서].crt