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.'

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).


Found the problem! As I asked for an approach to debug this...here is what I did:

The important point was finding the menu entry "Logging" in the Nexus Repository Manager. There you can simply change the log level for each java package Nexus consists of.

I simply changed all LogLevels for packages including "security" or "rest" to TRACE and triggered a publish request again. In the LogViewer (also part of Nexus) I now saw all the necessary information to understand the problem.

In my case, I had to add the nx-repository-view-*-*-edit privilege to the role I had created for the user that Jenkins uses to login to Nexus. I thought nx-repository-view-*-*-add is enough to publish.

Hope it helps!