Hey folks,
I’m stuck with a weird npm issue. Every time I try to run npm install
, I get this error:
npm ERR! RequestError: unable to get local issuer certificate
It’s driving me crazy! Here’s what I’ve tried so far:
- Ran
NODE_TLS_REJECT_UNAUTHORIZED=0 npm install
- Checked my proxy settings
- Cleared npm cache
- Used
npm install --legacy-peer-deps
- Messed with
NODE_EXTRA_CA_CERTS
Nothing’s worked! I’m on Node.js 23.10.0 and this happens when npm tries to download stuff from the internet.
Has anyone run into this before? Any ideas on how to fix it? Could it be something with my setup or Node version?
I’m totally stuck and would really appreciate any help!
yo, had the same problem last week. turns out my antivirus was messing with npm. try disabling it temporarily and see if that helps. if not, maybe check ur system time? incorrect time can mess with certificates. good luck man!
I faced a similar issue a while back, and it turned out to be related to my company’s SSL inspection. If you’re on a corporate network, they might be intercepting HTTPS traffic, which can cause these certificate errors.
What worked for me was installing the company’s root certificate into Node’s certificate store. You can do this by downloading the certificate from your IT department and then setting the NODE_EXTRA_CA_CERTS environment variable to point to it.
Another thing to try is using a package manager like Yarn instead of npm. Sometimes Yarn handles these certificate issues better.
If all else fails, you might need to set up a local npm registry mirror using something like Verdaccio. It’s a bit of work to set up, but it can bypass a lot of these certificate headaches.
Hope this helps! Let us know if you figure it out.
I’ve encountered this issue before, and it’s often related to corporate network settings or outdated certificates. Have you tried updating your Node.js and npm to the latest versions? Sometimes, older versions can have certificate issues. Also, check if you’re behind a corporate firewall or using a VPN - these can interfere with npm’s ability to verify certificates. As a last resort, you might want to temporarily disable SSL verification with ‘npm config set strict-ssl false’, but be cautious with this approach as it reduces security. If none of these work, it might be worth checking with your network administrator, as there could be a network-level certificate issue at play.