Error while attempting to build Atom behind Proxy


#1

I am following the build instructions for installing Atom on Linux. I have all the necessary dependencies, and have cloned ungit to my machine and cd’d to the directory.

Now when I run script/build I get the following output:

Node: v0.10.29
npm: v1.4.14
Installing build modules...
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! System Linux 3.2.0-65-generic-pae
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "--userconfig=/home/ajedi32/sandbox/atom/.npmrc" "install" "--quiet"
npm ERR! cwd /home/ajedi32/sandbox/atom/build
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ECONNRESET
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ajedi32/sandbox/atom/build/npm-debug.log
npm ERR! not ok code 0

npm-debug.log: http://pastebin.com/g6wNMi8P

System information:

  • I am behind a corporate proxy which I cannot change the settings for
  • I am running Ubuntu 12.04 LTS (32 bit, even though my CPU supports 64 bits)
  • Running Node v0.10.29
  • Running npm v1.4.14
  • Running git 1.8.3.3

My NPM config file:

$ npm config list
; cli configs
registry = "https://registry.npmjs.org/"
user-agent = "npm/1.4.14 node/v0.10.29 linux ia32"

; userconfig /home/ajedi32/.npmrc
https-proxy = "http://localhost:3128/"
proxy = "http://localhost:3128/"

; node bin location = /usr/local/bin/node
; cwd = /home/ajedi32/sandbox/atom
; HOME = /home/ajedi32
; 'npm config ls -l' to show all defaults.

I am able to install other NPM packages (like Ungit), but atom is not working for some reason.


#2

Have you followed the instructions in the apm README?


#3

I think you’ve misunderstood. I’m not trying to install a package for Atom, I’m trying to install Atom itself.


#4

To my understanding, there are parts of the Atom build process that use apm to retrieve Atom packages. I could be wrong, but at least it was something to try :smile:


#5

Hmm, okay then I’ll give it a shot.


#6

Nope, I just ran through the instructions there and re-ran script/build. No luck. I’m getting the same error message as before.


#7

Okay, so I tried changing my *_proxy environment variables to include a protocol and got a slightly different error message:

$ echo $http_proxy
localhost:3128

$ echo $https_proxy
localhost:3128

$ echo $HTTP_PROXY
localhost:3128

$ echo $HTTPS_PROXY
localhost:3128

$ http_proxy=http://$http_proxy/ https_proxy=$http_proxy HTTPS_PROXY=$http_proxy HTTP_PROXY=$http_proxy script/build
Node: v0.10.29
npm: v1.4.14
Installing build modules...
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz
npm ERR! fetch failed https://registry.npmjs.org/slide/-/slide-1.1.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/getobject/-/getobject-0.1.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/underscore.string/-/underscore.string-2.2.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/eventemitter2/-/eventemitter2-0.4.14.tgz
npm ERR! fetch failed https://registry.npmjs.org/hooker/-/hooker-0.2.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/match-stream/-/match-stream-0.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/semver/-/semver-2.3.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/binary/-/binary-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/exit/-/exit-0.1.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/which/-/which-1.0.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/js-yaml/-/js-yaml-2.0.5.tgz
npm ERR! fetch failed https://registry.npmjs.org/pullstream/-/pullstream-0.4.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/grunt-legacy-log/-/grunt-legacy-log-0.1.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/dateformat/-/dateformat-1.0.2-1.2.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/fstream/-/fstream-0.1.28.tgz
npm ERR! fetch failed https://registry.npmjs.org/colors/-/colors-0.6.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.2.11.tgz
npm ERR! fetch failed https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/nopt/-/nopt-2.1.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/less/-/less-1.5.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/grunt-lib-contrib/-/grunt-lib-contrib-0.6.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/glob/-/glob-4.0.4.tgz
npm ERR! fetch failed https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/marked/-/marked-0.3.2.tgz
npm ERR! fetch failed https://registry.npmjs.org/colors/-/colors-0.6.0-1.tgz
npm ERR! fetch failed https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/underscore.string/-/underscore.string-2.3.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz
npm ERR! fetch failed https://registry.npmjs.org/parseurl/-/parseurl-1.1.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/debug/-/debug-1.0.3.tgz
npm ERR! fetch failed https://registry.npmjs.org/ycssmin/-/ycssmin-1.0.1.tgz
npm ERR! fetch failed https://registry.npmjs.org/source-map/-/source-map-0.1.11.tgz
npm ERR! fetch failed https://registry.npmjs.org/source-map/-/source-map-0.1.37.tgz
npm ERR! git clone git://github.com/michaelficarra/cscodegen.git Cloning into bare repository '/home/ajedi32/.atom/.npm/_git-remotes/git-github-com-michaelficarra-cscodegen-git-c4b567f3'...
npm ERR! git clone git://github.com/michaelficarra/cscodegen.git 
npm ERR! git clone git://github.com/michaelficarra/cscodegen.git fatal: unable to connect to github.com:
npm ERR! git clone git://github.com/michaelficarra/cscodegen.git github.com[0: 192.30.252.129]: errno=Connection timed out
npm WARN optional dep failed, continuing cscodegen@git://github.com/michaelficarra/cscodegen.git#73fd7202ac086c26f18c9d56f025b18b3c6f5383
npm ERR! fetch failed https://registry.npmjs.org/escodegen/-/escodegen-0.0.28.tgz
npm ERR! fetch failed https://registry.npmjs.org/escodegen/-/escodegen-0.0.28.tgz
Installing apm...
npm ERR! git clone git://github.com/nathansobo/node-plist.git Cloning into bare repository '/home/ajedi32/.atom/.npm/_git-remotes/git-github-com-nathansobo-node-plist-git-28e79487'...
npm ERR! git clone git://github.com/nathansobo/node-plist.git 
npm ERR! git clone git://github.com/nathansobo/node-plist.git fatal: unable to connect to github.com:
npm ERR! git clone git://github.com/nathansobo/node-plist.git github.com[0: 192.30.252.131]: errno=Connection timed out
npm ERR! Error: Command failed: fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.131]: errno=Connection timed out
npm ERR! 
npm ERR! 
npm ERR!     at ChildProcess.exithandler (child_process.js:647:15)
npm ERR!     at ChildProcess.emit (events.js:98:17)
npm ERR!     at maybeClose (child_process.js:755:16)
npm ERR!     at Socket.<anonymous> (child_process.js:968:11)
npm ERR!     at Socket.emit (events.js:95:17)
npm ERR!     at Pipe.close (net.js:465:12)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.2.0-65-generic-pae
npm ERR! command "node" "/home/ajedi32/sandbox/atom/build/node_modules/.bin/npm" "--userconfig=/home/ajedi32/sandbox/atom/.npmrc" "install" "--quiet"
npm ERR! cwd /home/ajedi32/sandbox/atom/apm
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code 128
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ajedi32/sandbox/atom/apm/npm-debug.log
npm ERR! not ok code 0

Not sure if that’s better or worse than before. It looks like it’s failing to download any https resources. As for the git resources, I never was able to get git:// clone URLs from outside the firewall to work for me.

Is there any way to do an offline build of Atom?


Building/Installing Atom on Linux without an Internet Connection
#8

I’m having the same problem as referenced here. There is a lot of detail and a workaround described here. You can apparently set up a proxy on your own machine for npm https requests to make it play nicely with your firewall. I decided to use a compiled version of Atom instead of spending even more time trying to fix this. Please let me know if you get this working properly.


#9

I’m already using CNTLM, and have been for some time. The workaround described unfortunately does not help me at all.


#10

I decided to use a compiled version of Atom instead of spending even more time trying to fix this.

Where did you find a “compiled version of Atom” for Linux? That seems like a reasonable work-around to me.


ATOM build on Linux behind Proxy
#11

I used the webupd8 repository. It wasn’t updating lately, but I think it’s back to normal now (I updated to atom 0.123.0 today from it).