This behavior happens when attempting to run the “npm login” command and Artifactory is forwarding the NPM login request to a configured OAuth SSO.
Since currently the OAuth SSO configuration supports only a GitHub Enterprise OAuth provider, setting a different provider and configuring it as the “Default GitHub Provider” under Artifactory UI > Admin > Security > OAuth SSO may cause the ERR! 500.
To resolve this, uncheck the “Default GitHub Provider” under Artifactory UI > Admin > Security > OAuth SSO > “Default GitHub Provider”, as follows (blank it):
Afterward, you should be able to login successfully.