1

我目前一直在设置 Nexus 3.2,尤其是 NPM 存储库。我有一个代理存储库指向registry.npmjs.org我已成功发布到同一实例上的托管存储库以及使用npm update -g.

不幸的是,通过小组下载范围项目不起作用,这对于进行 Angular 2 开发至关重要。当我尝试时,我收到 404 错误:

brian$ npm install "@angular/common"
npm ERR! registry error parsing json
npm ERR! Unexpected token < in JSON at position 0
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>404 Not Found</title>
npm ERR! </head><body>
npm ERR! <h1>Not Found</h1>
npm ERR! <p>The requested URL /nexus/repository/npm_group/@angular/common was not found on this server.</p>
npm ERR! </body></html>
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/brian/.npm/_logs/2017-03-28T07_38_37_824Z-debug.log

Scopes 是 3.x 的一个高度吹捧的特性,我很高兴它们大部分都在工作。因为我可以发布到受保护的存储库并且代理存储库填充了非范围依赖项,所以我认为我非常接近。我该如何调试呢?

FWIW,我在 Apache HTTPd 服务器后面有 Nexus:

ProxyPass /nexus http://dev.example.com:8081/nexus nocanon
ProxyPassReverse /nexus http://dev.example.com:8081/nexus
  AllowEncodedSlashes On
<Location /nexus>
  RequestHeader set X-Forwarded-Proto "https"
  RequestHeader set X-Forwarded-Port "443"
</Location>

谢谢!

4

1 回答 1

5

已解决这个 SO 答案涵盖了使用的细微差别AllowEncodedSlashes

错误 46830:如果在全局上下文中设置了 AllowEncodedSlashes On,则它不会被虚拟主机继承。您必须在每个容器中显式设置 AllowEncodedSlashes On。

由于我有上面的配置,AllowEncodedSlashes在我拥有的范围内添加它是不正确的,它需要放在VirtualHostSSL 的范围内。就我而言,那是 NSS 模块(因为我有由FreeIPA更新的证书)。

一旦改变了,一切都很好。

于 2017-03-28T19:10:19.817 回答