Getting E403 Forbidden error when running npm install command

I’m facing an issue when trying to run npm install in my project directory. Keep getting this E403 Forbidden error that’s blocking me from installing packages.

npm WARN deprecated [email protected]: Request has been deprecated, see
https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: watchpack@^2.0.0
(node_modules\webpack\node_modules\watchpack):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: 403 Forbidden:
https://registry.npmjs.org/watchpack/-/watchpack-2.1.1.tgz

npm ERR! code E403
npm ERR! 403 Forbidden: file-type@^16.0.0

Running npm version 6.14.8 with node v14.17.0. Just did a fresh Windows install today and had to set everything up again. Everything was working fine before the reinstall.

Every package installation attempt is failing now. Here’s what I have in my .npmrc configuration:

registry=http://registry.npmjs.org/

proxy=http://my_user:my_pass@company_proxy:8080

https-proxy=http://my_user:my_pass@company_proxy:8080

strict-ssl=false

Tried different solutions but nothing works so far. My password has an ‘@’ character but I properly encoded it as %40 in the config file.

Any ideas what might be causing this?

check if ur npm token expired or got revoked - that’s usually what causes 403s after fresh installs. run npm whoami to see if you’re still authenticated. you might need to npm login again or regenerate your access token from npmjs.com if u were using one before the reinstall.

This screams registry auth issue mixed with proxy problems. E403 after a fresh Windows install means npm can’t authenticate through your corporate proxy to hit the registry. I’ve been there - our company changed their proxy auth method and it broke everything. Windows credential storage wasn’t syncing with npm’s proxy auth after the reinstall. First, try npm config set registry https://registry.npmjs.org/ - you’re using http and some proxies block that for security. Also check if your company proxy needs NTLM auth instead of basic auth. You might need proxy-auth-type=ntlm in your .npmrc file. Lots of corporate environments switched to this after security updates and it completely breaks the standard username:password format.

Had the same problem after reinstalling Windows - corporate proxies are a pain. E403 usually means corrupted cache or your auth timed out. Try npm cache clean --force first, then npm cache verify to check everything’s good.

Also check your .npmrc file - make sure it’s registry=https://registry.npmjs.org/ (not http). Some corporate networks hate mixed http/https traffic and throw 403 errors.

If you’re still stuck, test with npm install --no-proxy to see if it’s actually your proxy causing issues. Worth checking if your company changed any proxy settings recently too.

Corporate proxy auth gets messy after reinstalls. You encoded the ‘@’ in your password as %40, but check if your username needs encoding too - special characters there will throw 403 errors. See if IT can set up a simple test account temporarily. I’ve also had Windows credential manager mess with npm auth on fresh installs. Run npm config get proxy and npm config get https-proxy to make sure your encoded credentials actually saved right. Sometimes the encoding breaks when writing the config and you get auth failures that look like permission problems.

Your proxy settings look fine, but E403 after fresh installs usually means npm’s hitting rate limits or auth issues that won’t go away with manual fixes.

I used to waste hours debugging npm proxy configs. Now I just automate the whole package management process with Latenode through automated workflows.

Set up automation that watches your package.json changes and runs installs through different registry endpoints automatically. It retries failed installs, switches between mirrors, and handles proxy rotation when needed.

Once you automate this, you never manually troubleshoot npm errors again. The workflows handle retries and fallbacks automatically.

For now, try npm config delete proxy and npm config delete https-proxy to test without proxy first. But seriously, automate this so you don’t hit the same wall on your next reinstall.