gpt4 book ai didi

node.js - Nexus 与 NPM - 登录问题

转载 作者:太空宇宙 更新时间:2023-11-03 22:22:12 25 4
gpt4 key购买 nike

我在代理后面有一个 Nexus 服务器,并在 Nexus 中激活 npm Bearer Token Realm。有 3 个存储库:npm(组,包括 npm-private 和 npm-registry)、npm-private(托管)和 npm-registry(代理到 https://registry.npmjs.org/ )。配置 Nexus 后,我想通过 npm 登录使用我的用户凭据登录:

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

此外,我还配置了必要的 SSL 证书:

npm config set cafile /path/to/url

现在我想登录,但出现以下错误:

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: 'test@email.de',
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:

有人有提示或想法吗?我找了半天的解决方案。 :(

代理有效。地址https://repo.company.de/repository/npm/可以通过浏览器访问。 Nexus 在 Docker 容器中运行。我在 Nginx 代理日志和 Nexus 日志中找不到任何错误。

如果我尝试以下操作(http 而不是 https):

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

我得到a SyntaxError: Unexpected token < in JSON at position 0 ,因为html代码回来了。

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>

逻辑上,由于设置了从 http 到 https 的转发。

最佳答案

这是 Node 版本中的一个错误:https://github.com/nodejs/node/issues/19359

通过 node --version 我找到了版本。之后,我更新了 Node.js,每个人都工作了。

关于node.js - Nexus 与 NPM - 登录问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53152745/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com