[SOLVED] npm install shows CERTIFICATE_VERIFY_FAILED

Just wanted to add this because after much searching I couldn’t find this specific answer.

OS: freebsd, and install errors out with:

Downloading openssl source from https://www.openssl.org/source/openssl-3.0.7.tar.gz
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate ...

In my case I needed to run the environment variables up front:
REQUESTS_CA_BUNDLE='/usr/local/etc/ssl/cert.pem' SSL_CERT_FILE='/usr/local/etc/ssl/cert.pem' npm install mediasoup@3

2 Likes