sourcemint / sm-npm

25 stars 4 forks source link

sm install losing proxy information #11

Closed xtra-be closed 11 years ago

xtra-be commented 12 years ago

i'm trying to install cloud9 on a system behind a proxy npm can correclty access the proxy and i'm able to install packages with npm however when doing sm install on cloud9 i get following error:

sm install Running: npm install . (cwd: /root/cloud9) Locating NPM package 'https://github.com/ajaxorg/apf/tarball/855302855ba9e2953f74f93cd5ea56af2b6bf543' to be installed at '/root/cloud9/node_modules/apf' Locating: https://github.com/ajaxorg/apf/tarball/855302855ba9e2953f74f93cd5ea56af2b6bf543 http GET https://github.com/ajaxorg/apf/tarball/855302855ba9e2953f74f93cd5ea56af2b6bf543

cadorn commented 12 years ago

How do you tell NPM that you are behing a proxy?

Sometimes sm clones a project using git. Can the git URIs be proxied too? Is there docs for that anywhere?

xtra-be commented 12 years ago

proxy setting have been set using npm config set https-proxy & npm config set http-proxy also proxy is set in the environment

tvanier commented 12 years ago

Seems I am facing the same problem, cannot sm install behind a proxy after

Locating NPM package 'https://github.com/ajaxorg/ace/tarball/445767a5982d44b35b9e9061025d6f0d2fd4dad2' to be installed at '/home/.../cloud9/node_modules/ace'
Locating: https://github.com/ajaxorg/ace/tarball/445767a5982d44b35b9e9061025d6f0d2fd4dad2
http GET https://github.com/ajaxorg/ace/tarball/445767a5982d44b35b9e9061025d6f0d2fd4dad2
  * ERROR ***************************************************************************
  * Error: connect EHOSTUNREACH In package: /home/.../cloud9
  * Code : EHOSTUNREACH
  * File : false @ false
  * Stack:
  *    Error: connect EHOSTUNREACH
  *        at errnoException (net.js:670:11)
  *        at Object.afterConnect [as oncomplete] (net.js:661:19)
  * ERROR ***************************************************************************
cadorn commented 12 years ago

The proxy configuration is currently not respected.

To implement this, proxy support must be implemented for HTTP (by looking at the proxy environment variables) & SSH (which may already work).

For HTTP we could use the request npm module.

I would welcome a pull request. Otherwise I just about have sm deploy finished which can provision a remote server. I am then setting up an automated remote test environment. Once that is done I can easily work on this issue.

cadorn commented 11 years ago

http_proxy and https_proxy ENV vars will be respected as of sm@0.3.0 to be released this or next week. See: https://github.com/sourcemint/util-js/commit/0a93bad34d47fd4e57f3186c842c91a2fdf545f0

zhizhangchen commented 11 years ago

It still doesn't work using the newest version from git. I tried to install sm using npm or using git and then install the newest version of util-js from git and delete the installed util-js module in sm, then following error occurs when try to do "su install": ERROR ***

cadorn commented 11 years ago

Unfortunately I don't know why it does not work with sm@0.2 and don't want to invest more time into it.

sm@0.3 has been a bit delayed. I am trying to get a release out before the end of the year. If it still does not work with the new release we can troubleshoot further then.

If you find the cause of the issue in 0.2, please update this issue.