我试图在公司防火墙后面的redhat 6上从零开始构建atom.io,而我似乎无法做出不起作用的正面或反面
这些问题上有各种各样的帖子,但它们似乎都没有帮助解决我的具体问题:(https://stackoverflow.com/search?q=npm+tunnel+socket)。我花了很多时间在这里搜索,github搜索其他"答案"其中大多数都包括添加以下部分或全部配置选项> 提供的修复包括:
正如您所看到的,我已经尝试了所有这些不同的设置(这是我的npm配置选项) - 虽然我不确定它们是否实际上都在工作(见下文)
; cli configs
user-agent = "npm/2.5.1 node/v0.12.0 linux x64"
; userconfig /home/jstein/.npmrc
http-proxy = "http://gatekeeper.mitre.org:80"
https-proxy = "http://gatekeeper.mitre.org:80/"
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"
proxy = "http://gatekeeper-w.mitre.org:80/"
registry = "http://registry.npmjs.org/"
strict-ssl = false
; node bin location = /devel/software/node-v0.12.0-linux-x64/bin/node
; cwd = /devel/software/atom
; HOME = /home/jstein
; 'npm config ls -l' to show all defaults.
即使使用这些设置,我的构建如果以神秘的方式失败:
Node: v0.12.0
npm: v2.5.1
Installing build modules...
npm ERR! Linux 2.6.32-431.23.3.el6.x86_64
npm ERR! argv "/devel/software/node-v0.12.0-linux-x64/bin/node" "/devel/software/node-v0.12.0-linux-x64/ bin/ npm" "--userconfig=/devel/software/atom/.npmrc" "install" "--loglevel" "error"
npm ERR! node v0.12.0
npm ERR! npm v2.5.1
npm ERR! code ECONNRESET
npm ERR! network tunneling socket could not be established, cause=connect EINVAL
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! Please include the following file with any support request:
npm ERR! /devel/software/atom/build/npm-debug.log
然而,当我查看构建日志时,我看到了一些好奇的东西:
396 info attempt registry request try #1 at 10:20:13 AM
397 http request GET https://registry.npmjs.org/grunt-contrib-coffee
398 verbose request uri https://registry.npmjs.org/grunt-contrib-csslint
399 verbose request no auth needed
它似乎仍在尝试点击 https 注册表而不是收听命令registry = "http://registry.npmjs.org/"
,所以我想知道这是否是原因的一部分。
另外我不确定的是我如何从命令行测试它。有办法吗
npm request get ....
或类似的东西?
为了完整起见,我失败的构建日志以:
结束690 verbose stack Error: tunneling socket could not be established, cause=connect EINVAL
690 verbose stack at ClientRequest.onError (/devel/software/node-v0.12.0-linux-x64/lib/node_modules/ npm/ node_modules/request/node_modules/tunnel-agent/index.js:168:17)
690 verbose stack at ClientRequest.g (events.js:199:16)
690 verbose stack at ClientRequest.emit (events.js:107:17)
690 verbose stack at Socket.socketErrorListener (_http_client.js:272:9)
690 verbose stack at Socket.emit (events.js:107:17)
690 verbose stack at net.js:451:14
690 verbose stack at process._tickCallback (node.js:355:11)
691 verbose cwd /devel/software/atom/build
692 error Linux 2.6.32-431.23.3.el6.x86_64
693 error argv "/devel/software/node-v0.12.0-linux-x64/bin/node" "/devel/software/node-v0.12.0-linux-x64/ bin /npm" "--userconfig=/devel/software/atom/.npmrc" "install" "--loglevel" "error"
694 error node v0.12.0
695 error npm v2.5.1
696 error code ECONNRESET
697 error network tunneling socket could not be established, cause=connect EINVAL
697 error network This is most likely not a problem with npm itself
697 error network and is related to network connectivity.
697 error network In most cases you are behind a proxy or have bad network settings.
697 error network
697 error network If you are behind a proxy, please make sure that the
697 error network 'proxy' config is set properly. See: 'npm help config'
698 verbose exit [ 1, true ]
我想建议我可以采取的其他步骤,或者更好的方法来弄清楚这些错误发生了什么。我的工作确实使用某种SSL检查,可能会破坏https连接,但是,我认为配置设置应该禁止这种情况。
感谢。