Software⏱️ 2 min read📅 2026-05-30

How to Fix: receiving error: 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' while using npm

Quick Answer: Try adding the self-signed certificate to the trusted store by running `sudo apt-get install ca-certificates` and then `update-ca-certificates` commands on Ubuntu.

The error 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' occurs when npm is unable to verify the authenticity of a self-signed certificate. This issue can arise when using a self-signed certificate, such as in development environments.

✅ Best Solutions to Fix It

Method 1: Adding the Self-Signed Certificate to the Trusted Store

  1. Step 1: Run the command `sudo apt-get install ca-certificates` on your Ubuntu system to update the certificate store.

Method 2: Ignoring the Error and Using a Proxy

  1. Step 1: Set up a proxy server that can bypass the SSL verification, such as using `npm config set proxy http://your-proxy-server:8080`.

💡 Conclusion

To resolve the 'Error: SSL Error: SELF_SIGNED_CERT_IN_CHAIN' issue, you can either add the self-signed certificate to the trusted store or ignore the error and use a proxy server.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions