Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nexus with NPM - Login problems

Tags:

node.js

npm

nexus

I have a Nexus server behind a proxy and activate npm Bearer Token Realm in Nexus. There are 3 repositories: npm (group, which include npm-private and npm-registry), npm-private (hosted) and npm-registry (proxy to https://registry.npmjs.org/). After configuration the nexus, i want to login with my user credentials over npm login:

npm login --registry=https://repo.company.de/repository/npm/

Additionally i configure the necessary SSL certificates with:

npm config set cafile /path/to/url

Now i want to login, but i got following error:

npm verb adduser before first PUT { _id: 'org.couchdb.user:william',
npm verb adduser   name: 'william',
npm verb adduser   password: 'XXXXX',
npm verb adduser   email: '[email protected]',
npm verb adduser   type: 'user',
npm verb adduser   roles: [],
npm verb adduser   date: '2018-11-13T12:03:03.036Z' }
npm verb request uri https://repo.company.de/repository/npm/-/user/org.couchdb.user:william
npm verb request new user, so can't send auth
npm info attempt registry request try #1 at 13:03:03
npm verb request id bcc947edff8938be
npm http request PUT https://repo.company.de/repository/npm/-/user/org.couchdb.user:william
npm info retry will retry, error on last attempt: Error: write EPROTO 140175482243968:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:802:

Does anyone have a tip or an idea what it can be? I'm looking for half a day for a solution. :(

The proxy works. The address https://repo.company.de/repository/npm/ is accessible via the browser. The Nexus run in a docker container. I can't find any error in Nginx proxy logs and in Nexus logs.

If I try following (http instead of https):

npm login --registry=http://repo.company.de/repository/npm/

I get a SyntaxError: Unexpected token < in JSON at position 0, because html code comes back.

npm verb bad json <html>
npm verb bad json <head><title>301 Moved Permanently</title></head>
npm verb bad json <body bgcolor="white">
npm verb bad json <center><h1>301 Moved Permanently</h1></center>
npm verb bad json <hr><center>nginx/1.15.3</center>
npm verb bad json </body>
npm verb bad json </html>

Logically, since a forwarding from http to https is set up.

like image 324
William Avatar asked Oct 15 '25 20:10

William


1 Answers

It was a bug in Node version: https://github.com/nodejs/node/issues/19359

With node --version I find the version. After this, I update Node.js and everyone works.

like image 193
William Avatar answered Oct 18 '25 10:10

William



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!