How to debug 'npm ERR! 403 In most cases, you or one of your dependencies are requesting a package version that is forbidden by your security policy.'
Solution 1:
If you are like me and following the Node Cookbook example, or some other example where you just made your account, your error is probably like mine.
I hadn't verified my email address and got the same error (it was a new account). Once I verified, it worked (even on VPN).
Check your email and verify your account.
Solution 2:
I got the same error while publishing to JFrog Artifactory. It was the result of already having a package with the same name in the repository. In order to fix this, either delete the old package or change the version/name of the new one.
Solution 3:
This is mainly occur in two scenearios
-
The error may result due to a *conflicting package that is public. Just change the name of the package in the
package.json
and try again! -
You may have signed up recently and forgot to verify the email. So, you can login to this link: https://www.npmjs.com/login
On the header you will see an option to send a verification link to your email. Once you complete the verification, try to publish it again.
Remark: 2) worked for me.