Software⏱️ 2 min read📅 2026-06-03

How to Fix: How to fix SSL certificate error when running Npm on Windows?

SSL certificate error when running npm on Windows.

Quick Answer: Check if your system date and time are correct, as some package repositories may use this information to verify the authenticity of the request.

The 'tunneling socket could not be established, statusCode=403' error typically occurs when the SSL certificate is not properly configured or is not trusted by the system. This can happen due to various reasons such as a misconfigured server, an invalid SSL certificate, or a mismatch between the installed SSL certificates and the ones used by the server.

🛑 Root Causes of the Error

  • Incorrectly configured SSL certificate on the server.
  • Mismatch between installed and used SSL certificates.
  • Invalid or expired SSL certificate.

🚀 How to Resolve This Issue

Method 1: Verifying and Updating the SSL Certificate

  1. Step 1: Open Command Prompt as Administrator and run the command `certlm` to check if your system has a trusted root certificate.
  2. Step 2: If you find an invalid or untrusted certificate, update it by running the command `certlm -f ` (replace `` with the path to your updated SSL certificate).

Method 2: Configuring NPM to Ignore SSL Verification

  1. Step 1: Open the `npmrc` file in your user directory (usually located at `~\.npmrc`). Add the following line: `https://registry.npmjs.org/:http
  2. Step 2: Restart the Command Prompt and try running the npm command again.

🎯 Final Words

By following these steps, you should be able to resolve the 'tunneling socket could not be established' error and successfully install packages using npm. Remember to verify your SSL certificate regularly to avoid any future issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions