Why am I seeing ‘ERR! 500’ on npm login?

David Pinhas
2020-12-01 15:14

Issue 

When attempting to run ‘npm login –verbose’ the login results with the following error:

npm ERR! code E500
npm ERR! 500 Internal Server Error – PUT https://<ARTIFACTORY_URL>:<PORT>/artifactory/api/npm/npm/-/user/org.couchdb.user:<USER>

npm verb exit

This article will explain how to fix this behavior and login to the NPM registry successfully.

Resolution

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.