I’m having trouble with npm on a fresh Windows 10 setup. I’ve got Cygwin installed for Unix commands in cmd.
When I run npm install -g @angular/cli
, it starts downloading but then fails with this error:
gyp ERR! configure error
gyp ERR! stack Error: unable to get local issuer certificate
// ... (error message trimmed for brevity)
I tried editing the npm config file and added:
strict-ssl=false
http_proxy=null
proxy=null
But it didn’t help. The same error pops up for regular npm install
too. Any ideas on how to fix this certificate issue? I’m stuck and can’t install anything through npm.
yo try runnin npm config set strict-ssl false in cmd. that usually fixes these cert probs. if not, mayb check ur antivirus/firewall settings? they can mess with npm sometimes. also make sure ur using the latest node version, older ones can be buggy w/ certs.
This certificate error is a common headache with npm on Windows. Have you tried running npm with the --no-strict-ssl
flag? Like this: npm install -g @angular/cli --no-strict-ssl
. It often bypasses these certificate issues.
If that doesn’t work, you might need to update your npm’s CA certificates. Try running npm config set ca=""
in your command prompt. This clears the CA setting and lets npm use the built-in root CAs.
Another thing to check is your system’s date and time. If they’re off, it can cause certificate validation to fail. Make sure they’re set correctly.
Lastly, if you’re behind a corporate firewall, you might need to configure npm to use your company’s certificate. You’d need to get the certificate from your IT department and set it up with npm.