2015-02-06 309 views
2

我們目前正在使用Nexus 2.10,併成功將它用作npm的回購。在Sonatype Nexus上使用NPM訪問GitHub

通過這個代理/鏡像本地構建工作正常,但是當試圖在Bamboo上運行npm install(它沒有互聯網訪問)時,它失敗了,因爲一些依賴嘗試到達GitHub下載某個東西,失敗。

error 06-feb-2015 13:29:29 npm http 200 https://nexus.shdir.no/content/groups/npm-all/mkdirp/-/mkdirp-0.3.0.tgz 
error 06-feb-2015 13:29:30 npm http GET https://nexus.shdir.no/content/groups/npm-all/formidable 
error 06-feb-2015 13:29:30 npm http 200 https://nexus.shdir.no/content/groups/npm-all/formidable 
error 06-feb-2015 13:29:45 npm ERR! fetch failed https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz 
error 06-feb-2015 13:29:55 npm http GET https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz 
error 06-feb-2015 13:30:16 npm ERR! fetch failed https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz 
error 06-feb-2015 13:31:16 npm http GET https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz 
error 06-feb-2015 13:31:37 npm ERR! fetch failed https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz 
error 06-feb-2015 13:31:38 npm ERR! network connect ETIMEDOUT 
error 06-feb-2015 13:31:38 npm ERR! network This is most likely not a problem with npm itself 
error 06-feb-2015 13:31:38 npm ERR! network and is related to network connectivity. 
error 06-feb-2015 13:31:38 npm ERR! network In most cases you are behind a proxy or have bad network settings. 
error 06-feb-2015 13:31:38 npm ERR! network 
error 06-feb-2015 13:31:38 npm ERR! network If you are behind a proxy, please make sure that the 
error 06-feb-2015 13:31:38 npm ERR! network 'proxy' config is set properly. See: 'npm help config' 
error 06-feb-2015 13:31:38  
error 06-feb-2015 13:31:38 npm ERR! System Windows_NT 6.1.7601 
error 06-feb-2015 13:31:38 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" 
error 06-feb-2015 13:31:38 npm ERR! cwd E:\bamboo\UTV-FP-JOB1\code 
error 06-feb-2015 13:31:38 npm ERR! node -v v0.10.17 
error 06-feb-2015 13:31:38 npm ERR! npm -v 1.3.8 
error 06-feb-2015 13:31:38 npm ERR! syscall connect 
error 06-feb-2015 13:31:38 npm ERR! code ETIMEDOUT 
error 06-feb-2015 13:31:38 npm ERR! errno ETIMEDOUT 

我該如何解決這個問題?我必須將每個從github/bitbucket的回購添加到Nexus嗎?

回答

1

我們通過手動下載二進制文件並將它們添加到我們的Apache服務器來解決了這個問題。更新依賴關係時不會很有趣,但不應該太糟糕。只有3個文件。

我很樂意使用更好的解決方案,如果有人知道一個。

0

您必須使您的Bamboo服務器可以使用Nexus,並像在工作站上一樣配置npm。根據可能需要不同步驟的網絡拓撲結構安裝Bamboo和Nexus的位置。

理想情況下,您的存儲庫管理器和您的CI服務器位於同一位置,並且彼此之間具有高性能連接。這允許代理軟件包的快速下載以及快速部署。

例如,您可以在公共互聯網上使用Nexus並將其鎖定,以便僅允許通過身份驗證的訪問,然後像Bamboo那樣使用它。

+0

Nexus可用,位於npm回購的軟件包可從Bamboo獲得。這是對Github的直接http調用。是否可以說例如所有對github和bitbucket的https請求都可以通過?爲了充分利用網絡,可能是不行的,儘管我還沒有問過這個問題。而且在本地我們可以完全訪問互聯網。 – SimenB 2015-02-13 08:26:00

相關問題