Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Sonatype Nexus上使用NPM访问GitHub_Github_Npm_Nexus - Fatal编程技术网

在Sonatype Nexus上使用NPM访问GitHub

在Sonatype Nexus上使用NPM访问GitHub,github,npm,nexus,Github,Npm,Nexus,我们目前正在使用Nexus2.10,并已成功地将其用作npm的回购协议 通过此代理/镜像在本地构建工作正常,但当尝试在Bambol上运行npm install(无法访问internet)时,它失败了,因为某些依赖项试图到达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 erro

我们目前正在使用Nexus2.10,并已成功地将其用作npm的回购协议

通过此代理/镜像在本地构建工作正常,但当尝试在Bambol上运行
npm install
(无法访问internet)时,它失败了,因为某些依赖项试图到达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?

您必须使Nexus可用于您的Bamboo服务器,并像在工作站上一样在那里配置npm。根据竹和Nexus的网络拓扑安装位置,可能需要不同的步骤

理想情况下,您的存储库管理器和CI服务器位于同一位置,并且彼此之间具有高性能连接。这允许快速下载代理包以及快速部署


例如,您可以在公共internet上使用Nexus,并将其锁定为仅允许经过身份验证的访问,然后像从Bambol上使用Nexus一样使用它。

我们通过手动下载二进制文件并将其添加到Apache服务器来解决此问题。更新依赖项时不会很有趣,但也不会太糟糕。只有3个文件


我很乐意使用更好的解决方案,如果有人知道的话。

Nexus是可用的,位于npm回购协议的软件包可以从Bamboin获得。是对Github的直接http调用导致了内爆。是否可以说,例如,对github和bitbucket的所有https请求都可以直接通过?虽然我还没能问清楚,但完全上网可能是不可能的。在本地,我们可以完全访问互联网。