2017-08-16 64 views
1

我在我的內部企業網絡中設置了一個Nexus組和代理(如nexus 3文檔中所述)來緩存我的npm庫。我配置我的.npmrc如下:Nexus和NPM錯誤404

registry=http://<repo url>/repository/<group>/ 
[email protected] 
_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: [email protected] 
npm verb stack 
    at fetch.then.res ... 

但是當我用我的瀏覽器調用失敗的工件URL(404失敗)時,我得到沒有任何問題的相應工件的元數據。

我試過到目前爲止:

  • 添加/刪除企業代理:沒有變化
  • 直接使用的代理庫:然後我得到的每一個工件一個ECONNRESET雖然URL是我的瀏覽器
  • 可達

回答

0

好的,我的企業代理仍然是全球性的。我必須以某種方式執行npm config set ...一次。但是:當我使用npm config rm https_proxy刪除代理時,它開始工作完美!所以最後這是一個代理問題(無論什麼原因)。

它仍然有點奇怪,因爲nexus url以http開頭,而不是https,所以我不希望https代理出現問題。但我多次切換,以確保這確實是問題,事實確實如此。這可能是一個npm錯誤。