Nexus和NPM出错404

时间:2017-08-16 08:19:44

标签: npm http-status-code-404 nexus

我设置了一个Nexus组和代理(如nexus 3文档中所述),以便在我的内部企业网络中缓存我的npm库。我按如下方式配置了我的.npmrc:

registry=http://<repo url>/repository/<group>/
email=admin@company.com
_auth=YWRtaW46YWRtaW4=

当我以详细模式启动npm install时,我得到如下输出(只是摘录,有很多404):

....
fetch GET 200 http://<repo-url>/repository/<group>/camelcase 390ms
http fetch GET 200 http://<repo-url>/repository/<group>/run-sequence 171ms
fetch GET 200 http://<repo-url>/repository/<group>/lru-cache 343ms
http fetch GET 200 http://<repo-url>/repository/<group>/gulp 260ms
http fetch GET 200 http://<repo-url>/repository/<group>/tslint 591ms
httphttp fetch GET 200 http://<repo-url>/repository/<group>/gulp-flatten 193ms
 fetch GET 404 http://<repo-url>/repository/<group>/typescript 578ms
httphttp  fetchfetch GET 200 http://<repo-url>/repository/<group>/glob-stream 274ms
....

最终导致:

npm verb type OperationalError
npm verb stack Error: 404 Not Found: typescript@2.4.2
npm verb stack 
   at fetch.then.res ...

但是当我用浏览器调用失败的工件URL(用404失败)时,我会毫无问题地获得相应工件的元数据。

到目前为止我尝试了什么:

  • 添加/删除企业代理:无变更
  • 直接使用代理存储库:然后我为每个工件获取一个ECONNRESET,尽管我的浏览器中可以访问该URL

1 个答案:

答案 0 :(得分:0)

确定我的企业代理仍然是全局设置的。我必须以某种方式执行npm config set ...一次。但是:当我使用npm config rm https_proxy删除代理时,它开始完美运行!所以最后它是一个代理问题(无论出于何种原因)。

由于nexus url以http而不是https开头,所以仍然有点奇怪,所以我不希望这里的https代理出现问题。但我多次拨动以确保这确实是问题,事实确实如此。这可能是一个npm错误。