通过Nexus 3.2代理的范围NPM项目

通过Nexus 3.2代理的范围NPM项目,npm,nexus,nexus3,Npm,Nexus,Nexus3,我一直在设置Nexus3.2,尤其是目前的NPM存储库。我有一个指向registry.npmjs.org的代理存储库,我成功地在同一实例上发布到托管存储库,并使用npm update-g通过实例上的组存储库下载工件 不幸的是,通过小组下载范围明确的项目是不起作用的,这对于Angular 2开发至关重要。当我尝试时,我得到404个错误: brian$ npm install "@angular/common" npm ERR! registry error parsing json npm ERR

我一直在设置Nexus3.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
brian$npm安装“@angular/common”
npm错误!解析json时发生注册表错误
npm错误!JSON中位置0处出现意外标记<
npm错误!
npm错误!
npm错误!404找不到
npm错误!
npm错误!找不到
npm错误 在此服务器上找不到请求的URL/nexus/repository/npm_group/@angular/common

npm错误! npm错误! npm错误!此运行的完整日志可在以下位置找到: npm错误/Users/brian/.npm/_logs/2017-03-28T07_38_37_824Z-debug.log
Scopes是3.x的一项备受推崇的功能,我很高兴它们大部分都能正常工作。因为我可以发布到受保护的repo,并且代理存储库中填充了无范围的依赖项,所以我认为我非常接近。我如何调试这个

FWIW,我有一台ApacheHTTPD服务器背后的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>
ProxyPass/nexushttp://dev.example.com:8081/nexus 诺卡农
ProxyPassReverse/nexushttp://dev.example.com:8081/nexus
AllowEncodesOn
RequestHeader集合X-Forwarded-Proto“https”
RequestHeader设置X转发端口“443”
谢谢

已解决:涵盖使用
AllowEncodedsLash的细微差别

Bug 46830:如果在全局上下文中设置AllowEncodeDSLASH On,则虚拟主机不会继承它。您必须在每个容器中显式地将AllowEncodeDSLASH设置为On

由于我有上面的配置,在我的作用域中添加
allowencodedslass
是不正确的,它需要放在SSL的
VirtualHost
作用域中。在我的例子中,这就是NSS模块(因为我有由更新的证书)

一旦改变了,一切都很顺利。

解决了:涵盖了使用
AllowEncodedsLash的细微差别

Bug 46830:如果在全局上下文中设置AllowEncodeDSLASH On,则虚拟主机不会继承它。您必须在每个容器中显式地将AllowEncodeDSLASH设置为On

由于我有上面的配置,在我的作用域中添加
allowencodedslass
是不正确的,它需要放在SSL的
VirtualHost
作用域中。在我的例子中,这就是NSS模块(因为我有由更新的证书)

一旦改变了,一切都很顺利