How to Fix npm Error Code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

So there I was, setting up a fresh Node project on a corporate laptop at like 9am, coffee still brewing, and I run npm install — and boom. Red wall of text. The one that stops you cold:

npm error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm error errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm error network request to https://registry.npmjs.org/some-package failed
npm error network This is a problem related to network connectivity.

I've seen this error probably a hundred times across different teams and environments. It's one of those npm errors that looks terrifying but is almost always caused by the same handful of things. The short version: npm is trying to verify an SSL certificate during the install, and something in that chain is broken or untrusted. Could be a corporate proxy, a self-signed cert, or a VPN doing deep packet inspection. Fun stuff.

Alright, let's get into the actual fixes.

Fix #1: Tell npm to use your system's certificate store

This is the fix that works for most people on corporate networks. Your company's IT team has almost certainly installed a custom root CA on your machine — npm just doesn't know about it yet. You can point npm to your system's CA bundle explicitly.

First, find where your Node installation keeps its CA file. On most systems you can run:

node -e "console.log(require('tls').rootCertificates.length)"

That's just a sanity check. What you actually want to do is export your system certificates and tell npm to use them. On Windows, you can use a tool called win-ca or just grab the cert file directly. But the quickest cross-platform fix is this:

npm config set cafile /path/to/your/ca-bundle.crt

If you're on a corporate machine and your IT admin gave you a .crt or .pem file, that's the path you drop in there. On a lot of enterprise setups, there's already one sitting in something like C:\certs\company-root.crt or /etc/ssl/certs/ca-certificates.crt on Linux.

After setting that, run npm install again. Honestly, this alone resolves it about 70% of the time.

Fix #2: Disable strict SSL (carefully — read this first)

I want to be upfront here — this is a workaround, not a permanent solution. Disabling SSL verification is fine on a local dev machine behind a firewall, but you don't want this in a CI/CD pipeline or production environment. That said, sometimes you just need to get unblocked.

npm config set strict-ssl false

Run your install, get what you need, then turn it back on:

npm config set strict-ssl true

Or, if you only want to disable it for a single install without changing your global config:

npm install --legacy-peer-deps --strict-ssl=false

Now here's where it gets tricky — some people just leave strict-ssl false set globally and forget about it. I've audited projects where this was baked into the team's shared .npmrc file committed to the repo. Please don't do that. Fix the actual cert issue when you get time.

Fix #3: Set the registry to HTTP instead of HTTPS (for internal registries)

This one applies if you're using a private npm registry — like Artifactory, Verdaccio, or Nexus — and that's what's throwing the cert error. Sometimes the internal registry is running on HTTP or has a self-signed cert that npm won't trust.

Check your current registry setting first:

npm config get registry

If it's pointing to an internal URL, you've got two options. Either switch to HTTP temporarily:

npm config set registry http://your-internal-registry.company.com/

Or, better yet, add the certificate for your internal registry specifically rather than disabling SSL globally. You do that by adding a scoped cert in your .npmrc:

//your-internal-registry.company.com/:cafile=/path/to/registry-cert.pem

This is the cleanest approach because it only trusts that specific cert for that specific registry, rather than blowing up your SSL settings across the board. Takes an extra five minutes to set up but you'll thank yourself later.

Fallback: Clear the npm cache and check your proxy settings

If none of the above worked, two more things to try before you start Googling more aggressively.

Clear your npm cache — sometimes stale or corrupted cache entries cause weird cert-related behavior:

npm cache clean --force

Then check if you've got proxy settings that might be intercepting your traffic:

npm config get proxy
npm config get https-proxy

If either of those returns something that shouldn't be there, you can clear them:

npm config delete proxy
npm config delete https-proxy

Also worth checking your NODE_EXTRA_CA_CERTS environment variable. If it's set to a cert file that no longer exists, that'll cause this exact error. Just run echo $NODE_EXTRA_CA_CERTS (or echo %NODE_EXTRA_CA_CERTS% on Windows CMD) to see if it's pointing somewhere valid.

One last thing — if you're bouncing between a work network and home, this error has a habit of appearing whenever you switch environments. A VPN that does SSL inspection will cause this when you connect, and then it magically disappears when you disconnect. If that's the pattern you're seeing, the Fix #1 approach with your company's CA bundle is almost certainly the right long-term answer.

Hope this saves you the 45 minutes of Stack Overflow rabbit-holing I did the first time I hit this one.

๋Œ“๊ธ€

Mojang Session Servers Down? Here's Why You Can't Log Into Minecraft Right Now

Photo by Patrik Kernstock on Unsplash So you sit down to play some Minecraft, probably after a long day, maybe you've got friends waiting in a server lobby, and you get smacked with this: Failed to connect to the server. Error: Authentication servers are down for maintenance. Or sometimes it shows up as: Failed to login: Invalid session (Try restarting your game and the launcher) Yeah. The Mojang session servers are down, or at least they're not talking to your game properly. I've seen this come up constantly in forums and Discord servers whenever there's a Mojang outage, and the frustrating part is — half the time people don't even realize it's not their fault. Here's what's actually going on. Why This Happens Minecraft doesn't just let you waltz into a multiplayer server. Every time you connect, your client reaches out to Mojang's session servers at session.minecraft.net to verify you...

what is art therapy AI painting checker Introducing the AI HTP Test Site: A New Era in Art Therapy

 #what is art therapy #art therapy activities   AI Art Above is the AI ​​picture psychological test. Below is the AI ​​HTP tree human house test.  Psychotherapy test AI Art Psychotherapy HTP test Introducing the AI HTP Test Site: A New Era in Art Therapy What Is HTP? HTP (House-Tree-Person) is a well-known projective drawing test commonly used in art therapy and psychological evaluation. Participants draw a house, a tree, and a person, and mental health professionals interpret these drawings to gain insights into the individual’s emotional state, personality traits, and underlying issues. AI Meets HTP Thanks to advancements in artificial intelligence, the HTP test has evolved. Our AI HTP Test Site allows you to upload your drawings and receive a detailed, automated analysis. The system evaluates various elements—line thickness, spatial arrangement, color usage, and more—to provide immediate, data-drive...

์ด ๋ธ”๋กœ๊ทธ ๊ฒ€์ƒ‰

Zoho Mail IMAP Not Working: Every Fix I've Actually Used

Quick Summary Zoho Mail IMAP stops working for the dumbest reasons - wrong port, 2FA blocking app passwords, or DNS that looks fine but isn't. I've fixed this across Outlook 2016, iPhones, Android, and Mac Mail, and the root cause is almost always one of four things. Here's the exact step-by-step with real menu paths so you're not clicking around for two hours like I was the first time. Photo by Juanjo Jaramillo on Unsplash It was a Monday morning. One of our sales guys walks up and says his Outlook stopped pulling emails from Zoho. Just stopped. Overnight. Nothing changed - or so he said. Checked his machine, checked the account settings, everything looked right on the surface. Port 993, SSL enabled, correct email address. And yet. Nothing. Here's the thing - Zoho Mail IMAP issues have this annoying pattern where the settings look correct but something underneath is broken. Could be an app password that got invalidated when someone toggled 2FA. Could be IMAP ac...
↑