Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Sonatype Nexus respond with a 405 error to `npm login`?

Tags:

npm

nexus

When I attempt to npm login into to our Nexus Repository Manager npm repository, I get a response saying:

npm ERR! code E405
npm ERR! Registry returned 405 for PUT on http://hostname/-/user/org.couchdb.user:ci

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-07-23T17_30_33_494Z-debug.log

When I run the command with --verbose I get another hint saying:

npm http 405 ← HTTP method PUT is not supported by this URL (http://hostname/-/user/org.couchdb.user:ci)

Why is it not letting me log in?

like image 863
Oliver Salzburg Avatar asked Oct 29 '25 20:10

Oliver Salzburg


1 Answers

You forgot to supply the repository path in your registry URL.

Your registry URL is set to http://hostname/, which is only the base name of your NRM, which could hold multiple repositories with discrete permissions.

You need to provide the repository name like http://hostname/repository/npmjs-proxy/.

like image 188
Oliver Salzburg Avatar answered Nov 05 '25 07:11

Oliver Salzburg