Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jspm install fails behind proxy #10

Closed
yeban opened this issue Oct 26, 2013 · 67 comments
Closed

jspm install fails behind proxy #10

yeban opened this issue Oct 26, 2013 · 67 comments

Comments

@yeban
Copy link

yeban commented Oct 26, 2013

$ jspm install github:jquery

Getting version list for github:jquery
err  Error looking up version for jquery
     ssh: connect to host github.com port 22: Connection refused
     fatal: Could not read from remote repository.

     Please make sure you have the correct access rights
     and the repository exists.

     Config file updated.
     package.json updated.
warn Install finished, with errors.
@guybedford
Copy link
Member

"jquery" isn't a Github repo. Try github:components/jquery or github:jquery/jquery.

Even better, simply use jspm install jquery to use the copy in the jspm registry.

@yeban
Copy link
Author

yeban commented Oct 26, 2013

jspm install github:components/jquery@2.0.3 throws the same error.

@guybedford
Copy link
Member

I've added an --https option. Let me know if this works now for you.

@yeban
Copy link
Author

yeban commented Oct 27, 2013

Nope. jspm install --https github:components/jquery throws:

     Getting version list for github:components/jquery
     Downloading github:components/jquery@2.0.3
[error] connect ECONNREFUSED null components
     Checking github:components/jquery@2.0.3 for package.json override
err  TypeError: Object true has no method 'get'
         at Object.Installer.checkPackageOverride (/usr/local/lib/node_modules/jspm/jspm.js:301:11)
         at /usr/local/lib/node_modules/jspm/jspm.js:202:17
         at /usr/local/lib/node_modules/jspm/jspm-util.js:145:16
         at /usr/local/lib/node_modules/jspm/jspm-util.js:52:5
         at fs.js:207:20
         at OpenReq.Req.done (/usr/local/lib/node_modules/jspm-github/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:142:5)
         at OpenReq.done (/usr/local/lib/node_modules/jspm-github/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:64:22)
         at OpenReq.Req.done (/usr/local/lib/node_modules/jspm-github/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:142:5)
         at OpenReq.done (/usr/local/lib/node_modules/jspm-github/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:64:22)
         at OpenReq.Req.done (/usr/local/lib/node_modules/jspm/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:142:5)

@guybedford
Copy link
Member

Ok, I've included a fix for this. Try again.

@yeban
Copy link
Author

yeban commented Oct 27, 2013

Now I get:

     Getting version list for github:components/jquery
     Downloading github:components/jquery@2.0.3
[error] connect ECONNREFUSED null components
     Checking github:components/jquery@2.0.3 for package.json override
err  Error: connect ECONNREFUSED
         at errnoException (net.js:901:11)
         at Object.afterConnect [as oncomplete] (net.js:892:19)

My hunch is that it is not respecting http_proxy and https_proxy environment variable. I tried setting HTTPS_PROXY too.

On a related note, npm doesn't respect *_proxy environment variables either: I have to set proxy and https-proxy in ~/.npmrc for npm. It would be great if jspm could pick proxy settings from env ... or if it makes things easier, reuse ~/.npmrc maybe?

@guybedford
Copy link
Member

Ahh, yes this is because github is downloaded with the command:

  git clone --mirror https://github.com/components/jquery.git

If you run that command directly in the terminal does it work?

@yeban
Copy link
Author

yeban commented Oct 27, 2013

Yup. If I have https_proxy environment variable exported.

@guybedford
Copy link
Member

What does this environment variable actually do?

Should it be set directly in Node? For example:

  child_process.exec('git clone --mirror https://github.com/components/jquery.git', {
    env: {
      https_proxy: process.env.https_proxy
    }
  });

Or even:

  child_process.exec('git clone --mirror https://github.com/components/jquery.git', {
    env: process.env
  });

I don't have an understanding of the https_proxy thing, so would be good to know.

@yeban
Copy link
Author

yeban commented Oct 27, 2013

Commands like wget, curl, and git check for http(s)_proxy env variable(s). If set, they make network request through the proxy server specified in the variable.

Looks to me that it's not git clone ... that's causing trouble, rather Installer.checkPackageOverride. If you will take a second look at the stack track I posted, the error comes from net.js:

  1. git won't use net.js
  2. 'getting version list', which uses git ls-remotes, seems to work

That narrows the error to https://github.com/jspm/jspm/blob/master/jspm.js#L301

This post explains how to use Node's https.get through a proxy server: http://stackoverflow.com/questions/3862813/how-can-i-use-an-http-proxy-with-node-js-http-client

I will try to work out a patch later in the evening.

@guybedford
Copy link
Member

Thanks, that sounds like you've worked it out then.

If you can post a patch that would be great!

@guybedford guybedford reopened this Oct 27, 2013
@yeban
Copy link
Author

yeban commented Nov 1, 2013

The problem isn't resolved yet.

In reference to the commit attached above:

From behind an http proxy, whether I make a request to https endpoint or http, I must use http lib and not https 1. This was complicating the code so I switched to request lib (from npm) -- you just add proxy uri to request.get and it takes care of the rest (at least, theoretically).

  1. request.get takes a different callback compared to https.get and I am not sure what to change. If you agree with using request, perhaps you could make it work on your setup and then I could try behind proxy.
  2. request.get is returning 502 Gateway Error on my setup (from behind proxy). I was able to get up to here using http as well. :-/
  3. Might have to set {env: {https_proxy: process.env.https_proxy}} in execOpts as well. Can't be sure as I don't understand in what order the callbacks are being executed.

@guybedford
Copy link
Member

The proxy needs to use http, even for https (see http://stackoverflow.com/questions/3862813/how-can-i-use-an-http-proxy-with-node-js-http-client/5810547#6366629).

This way, we don't need request either.

Basically, have https and http as dependencies then do:

  var path = '/jspm/registry@master/package-overrides/' + fullName.replace(':', '/') + '.json';
  (function(handler) {
    if (process.env.https_proxy)
      http.get({
        host: process.env.https_proxy,
        path: 'https://github.jspm.io' + path
      }, handler);
    else
      https.get({
        host: 'https://github.jspm.io',
        path: path,
        rejectUnauthorized: false
      }, handler);
  })(function(res) {
    // .. as before
  });

I'd really appreciate if you can still try out the pull request as I am unable to test any proxy from my side.

@yeban
Copy link
Author

yeban commented Nov 1, 2013

Hey. Thanks for that snippet. I didn't think of using (function () {} ()) style. It sure makes things better.

I am aware that I need to use http. I mentioned this in my comment. And I get 502 error whether I use http or request.

I will try again after next Tuesday (I am going home now) and get back to you on require-less stuff too then. Thanks again.

@yeban
Copy link
Author

yeban commented Dec 12, 2013

Hey. I moved out of college in the last month and I have been working without pesky proxies since then. I am sorry, it won't be possible for me to work on this pull request now.

@guybedford
Copy link
Member

Thanks for letting me know - no problem at all.

@tauren
Copy link

tauren commented Aug 13, 2014

It looks like this may not yet be resolved. What is the current status? When I connect through corporate firewall:

:jspm install github:components/jquery --https

     Checking versions for github:components/jquery

err  Error: connect ECONNREFUSED
         at errnoException (net.js:904:11)
         at Object.afterConnect [as oncomplete] (net.js:895:19)

warn Installation changes not saved

Note the above happens whether I use --https or not. When connected outside corporate firewall:

:jspm install github:components/jquery

     Checking versions for github:components/jquery
     Downloading github:components/jquery@2.1.1
ok   Installed github:components/jquery as github:components/jquery@^2.1.1 (2.1.1)
ok   Loader set to local library sources

ok   Install complete

My jspm config includes username/password for github:

{
  "github": {
    "username": "tauren",
    "password": "***hidden***"
  }
}

I've configured .gitrc to use the osxkeychain credential helper and my github username/password is already stored in Keychain:

:more ~/.gitconfig 
[core]
        excludesfile = /Users/tmil11/.gitignore_global
[difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path = 
[mergetool "sourcetree"]
        cmd = /opt/homebrew-cask/Caskroom/sourcetree/1.9.5.2/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true
[push]
        default = matching
[credential]
        helper = osxkeychain

My .npmrc file has proxy values configured:

:more ~/.npmrc 
strict-ssl = false
registry = http://registry.npmjs.org/
proxy = http://proxy.host.com:8080/
https-proxy = http://proxy.host.com:8080

Lastly, proxy environment variables are configured in the shell:

:echo $HTTP_PROXY
http://proxy.host.com:8080
:echo $HTTPS_PROXY
http://proxy.host.com:8080

As far as I can tell, the issue is a problem with JSPM. It is a blocker at the moment, and I'd be happy to work on resolving the problem. But I'd like to know more details about the current status of this issue. I would also appreciate guidance on what might be wrong and where to find it in the code.

@guybedford
Copy link
Member

Yes - the https flag isn't wired through as an argument to the endpoint. This wiring seems to have been lost somehow, but should be fairly simple to get back.

@tauren
Copy link

tauren commented Aug 13, 2014

Github recommends using https because it will work everywhere including behind firewalls. I would suggest that https be the default in JSPM and let users override it to use ssh. What do you think?
https://help.github.com/articles/which-remote-url-should-i-use

Are you going to fix the wiring that got lost? Or should I look into it? Do you have any pointers on where to look?

@tauren
Copy link

tauren commented Aug 13, 2014

So... after some debugging, it looks like at least part of the problem may be the use of https, which doesn't natively support proxies as well as mikeal/request without using its proxy features. The github endpoint for instance makes use of request, but does not pass a proxy parameter. JSPM needs full proxy support before it will be taken seriously within any larger organizations.

I have shell commands to turn on and off command-line proxy support depending on if I'm in the office or not. It is critical that toggling proxy support works with JSPM as well.

One option is to utilize the http_proxy, 'HTTP_PROXY,https_proxy, andHTTPS_PROXYenvironment variables. There is a package that adds/wraps this torequest` (I have no experience with this package):
https://www.npmjs.org/package/bagofrequest

Another option is to make it easily configurable via command line commands such as jspm config. For instance:

jspm config proxy.host http://proxy.host.com:8080

This would allow proxy support to be turned on and off by running a shell script. There would need to be a way to remove the proxy setting, such as setting a property without a value: jspm config proxy.host. How are jspm config properties removed today besides editing .jspm/config?

Request can be configured to use a proxy for all commands:

request.defaults({
    proxy: 'http://proxy.host.com:8080'
});

Or it can be done on a per request basis:

request({
      uri: apiRemoteString + repo,
      headers: {
          'User-Agent': "jspm"
      },
      strictSSL: false,
      followRedirect: false,
     proxy: 'http://proxy.host.com:8080'
});

I really need to get this solved so I can use JSPM and would be happy to help. I'd like to coordinate so I don't work on something that someone else is already fixing. And I'd like pointers to places in the codebase that might need to be changed.

@guybedford
Copy link
Member

Yes comprehensive proxy support is definitely a priority. This affects:

  • Ensuring the option is wired through from install, inject and update through lib/core.js into lib/package.js.
  • Ensure the GitHub and npm endpoints behave correctly with the option
  • Ensure the getPackageOverride checks in lib/package.js use a proxy correctly
  • Ensure the registry lookups in lib/package.js also use the proxy correctly

If you do work on this, a PR would be very welcome. The soonest I will be able to look at it would be later this weekend myself.

@guybedford
Copy link
Member

I like the idea of jspm config proxy.host a lot. What other options would be necessary for full proxy support, or is it just a host? If so should it just be jspm config proxyhost?

Then lib/config.js can turn such a value into an environment variable when loaded and that makes wiring simpler.

@yeban
Copy link
Author

yeban commented Aug 14, 2014

protocol://username:password@host:port is the format. So you would need five fields.

Nothing would beat the convenience of jspm automatically picking up proxy setting from http_proxy / https_proxy environment variable. Then, depending on whether the user is behind proxy or not, she just sets or unsets one environment variable and everything works.

@guybedford
Copy link
Member

Right so if we just supported the environment variable would that be enough here? Or do you think the environment variable and a proxy config option?

@yeban
Copy link
Author

yeban commented Aug 15, 2014

I was just making a case to not ignore http_proxy env variable support. If you can support one, supporting the other would be rather trivial, right? Just that proxy setting in config would take precedence over env variable.

If I have to choose one? env variable. It would be sufficient most of the times. But there must be a reason that git, curl, wget and all support both.

@tauren
Copy link

tauren commented Aug 15, 2014

I've started working on adding proxy support to jspm-cli, jspm-npm, and jspm-github. I've discovered that jspm-cli uses Node's https.request while the npm and github endpoints use mikeal/request. Any objections if I change these dependencies to a solution that makes implementing proxies simpler and consistent? I'm looking at request, superagent-proxy, or bagofrequest as possible dependencies.

The reason I am suggesting to use jspm config proxy.host is so that jspm config proxy.noproxy can be used as well. There are certain hosts that should not be proxied, such as localhost, 127.0.0.1, and internal servers. This also maps to the standard environment variables HTTP_PROXY, NO_PROXY, etc.

I too am recommending that environment variables be honored by default and that jspm config proxy.host would override them.

We will need to at least pass the proxy information to custom endpoints so they can handle it themselves. But it would be really great if we could expose some sort of request object to the endpoints that natively supports proxying so that endpoint developers have less work to do. It could simply be passed in the options, but that doesn't seem very clean. Maybe a cleaner approach is to not expose the request object, but a helper that can manipulate requestOptions. Any other ideas?

@guybedford
Copy link
Member

This all sounds great.

I'd be happiest with the dependency on request to handle the proxy as it's the most trusted out there and the implementation seems most flexible and straightforward.

I think it's fine to give the endpoints a proxy option and then trust that they handle things accordingly (ideally themselves using request). The endpoint API is designed to make things simple, but I don't think we should hand-hold.

I completely agree with using environment variables with jspm config proxy.host overriding the environment variable. I like the idea of proxy.noproxy as well. How do you think we should handle boolean config like this?

@yeban
Copy link
Author

yeban commented Aug 15, 2014

@guybedford wrote:

I completely agree with using environment variables with jspm config proxy.host overriding the environment variable. I like the idea of proxy.noproxy as well. How do you think we should handle boolean config like this?

So on the env variable side, you need to respect three of them: http_proxy, https_proxy, no_proxy and their uppercase counterpart.

Env variable no_proxy is an exclude list. Entries are comma separated. e.g: export no_proxy=127.0.0.1,10.3.100.155.

But I am wondering if jspm really needs to support no_proxy. How likely is it that jspm will hit a server that's not github or npm? Will jspm will ever hit localhost or a server within the firewall to fetch packages, etc.? Is there even a provision to setup your own repositories?

@guybedford guybedford reopened this Jan 29, 2015
@tauren
Copy link

tauren commented Jan 29, 2015

I've had no proxy problems with jspm since the request module was fixed.
However I am also using a recent version of npm that also depends on the
fixed request module. More details about your environment would help.

On Thu, Jan 29, 2015, 1:17 AM Guy Bedford notifications@github.com wrote:

@faceleg https://github.com/faceleg thanks for posting - where abouts
is the install falling over? It would help to know, as I don't have an easy
testing environment for the proxy work my side.


Reply to this email directly or view it on GitHub
#10 (comment).

@faceleg
Copy link

faceleg commented Jan 29, 2015

@guybedford the furthest I got with debugging this was: https://github.com/jspm/jspm-cli/blob/master/lib/package.js#L456. Where is getPackageConfig declared?

@faceleg
Copy link

faceleg commented Jan 29, 2015

@tauren npm:font-awesome installs successfully, github repos are failing. My proxy disallows SSH, if that is relevant.

@guybedford
Copy link
Member

@faceleg that could well be it. Does it fail on the lookup or download stage? jspm github uses git in the background to do the lookups in https://github.com/jspm/github/blob/master/github.js#L285. Please do let me know if you manage to debug that further.

@guybedford
Copy link
Member

@faceleg perhaps log the exec command as well and see if you can run that from the command line ok.

@faceleg
Copy link

faceleg commented Jan 29, 2015

@guybedford fails on the download stage - the exec command works in jspm and on my CLI

@guybedford
Copy link
Member

@faceleg thanks for letting me know.

The next three things to check are:

@faceleg
Copy link

faceleg commented Jan 29, 2015

Updating jspm-github's request to 2.51 solved this for me. Want a PR?

@faceleg
Copy link

faceleg commented Jan 29, 2015

Waiiiitaminute, I see the GH module hasa 2.51 listed at https://github.com/jspm/github/blob/master/package.json#L22 but wasn't in mine, investigating.

@faceleg
Copy link

faceleg commented Jan 29, 2015

The v0.9.11 jspm-github that gets installed doesn't have the 2.51 request version listed in it's package json.

@guybedford
Copy link
Member

@faceleg nice!! The request update is in the master branch, not yet released - release should be out tomorrow with some luck.

@faceleg
Copy link

faceleg commented Jan 29, 2015

Cool. I guess re-close this then

@sylvainpolletvillard
Copy link

I have the same problem with my company proxy on Windows 7 :

jspm install github:jquery

warn Error on locate for github:jquery, retrying (1).
 Error: tunneling socket could not be established, cause=10000:error:140770FC:SSL    routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:795:

     at ClientRequest.onError    (C:\Utilisateurs\a526177\AppData\Roaming\npm\node_modules\jspm\node_modules\jspm-github\node_modules\request\node_modules\tunnel-agent\index.js:168:17)
     at ClientRequest.g (events.js:180:16)
     at ClientRequest.emit (events.js:95:17)
     at CleartextStream.socketErrorListener (http.js:1551:9)
     at CleartextStream.emit (events.js:95:17)
     at SecurePair.<anonymous> (tls.js:1410:15)
     at SecurePair.emit (events.js:95:17)
     at SecurePair.error (tls.js:1017:27)
     at CleartextStream.read [as _read] (tls.js:462:17)
     at CleartextStream.Readable.read (_stream_readable.js:340:10)

Same error for a NPM dependency. However, I don't have this issue with the "npm install" command.

Here is what I try :

Can you explain what is this error message and how can I solve this ? Thanks in advance

@guybedford
Copy link
Member

One thing to note is that github:jquery is not a valid install - try github:components/jquery rather.

Also ensure you have locally configured git to use the proxy as jspm calls out to the git command.

Apart from that I must admit I don't have much of a clue when it comes to proxies. Perhaps someone else here with more experience can help.

@sylvainpolletvillard
Copy link

I got the same error with github:components/jquery and npm:font-awesome. But it worked if if I use directly git clone or npm install commands. I'll check my local git configuration when I get back to work.

@capaj
Copy link

capaj commented May 15, 2015

@guybedford it is the same on the Win7 machines with io.js 2.0.1 behind proxy at a company I recently joined. I have git configured with

git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080

and my installs fail with:

C:\test>jspm i jquery
Package.json file does not exist, create it? [yes]:
Would you like jspm to prefix the jspm package.json properties under jspm? [yes]
:
Enter server baseURL (public folder path) [./]:
Enter jspm packages folder [.\jspm_packages]:
Enter config file path [.\config.js]:
Configuration file config.js doesn't exist, create it? [yes]:
Enter client baseURL (public folder URL) [/]:
Which ES6 transpiler would you like to use, Traceur or Babel? [babel]:
     Updating registry cache...

warn Error on locate for github:components/jquery, retrying (1).
     Error: getaddrinfo ENOTFOUND github.com github.com:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

warn Error on locate for github:components/jquery, retrying (2).
     Error: getaddrinfo ENOTFOUND github.com github.com:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
^CChcete ukončit dávkovou úlohu (A/N)?
^C
C:\test>jspm i lodash
Package.json file does not exist, create it? [yes]:
Would you like jspm to prefix the jspm package.json properties under jspm? [yes]
:
Enter server baseURL (public folder path) [./]:
Enter jspm packages folder [.\jspm_packages]:
Enter config file path [.\config.js]:
Configuration file config.js doesn't exist, create it? [yes]:
Enter client baseURL (public folder URL) [/]:
Which ES6 transpiler would you like to use, Traceur or Babel? [babel]:
     Updating registry cache...
     Looking up npm:lodash

warn Error on lookup for npm:lodash, retrying (1).
     Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

warn Error on lookup for npm:lodash, retrying (2).
     Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

warn Error on lookup for npm:lodash, retrying (3).
     Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

warn Error on lookup for npm:lodash
     Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
         at errnoException (dns.js:25:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)

err  Error looking up npm:lodash.

warn Installation changes not saved.

@guybedford
Copy link
Member

@capaj we don't support the global config - proxy is handled entirely via environment variables, as described in https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables.

@IcodeNet
Copy link

I hope my comment will help to understand the root of the problem.
The error I was getting when running from a command prompt: 'jspm install'
was
.....
Error on locate for github:
Error: connect ECONNREFUSED
......

In my case the issue was repeatable and it had to do with running the 'jspm install' under an administrator console.

I have managed to resolve this in two ways:

  • 1.) fire up normal cmd and then run again 'jspm install'

  • 2.) in the administrator cmd, run

           SET HTTP_PROXY=Corporate_Proxy
           SET HTTPS_PROXY=Corporate_Proxy
            install jspm
    

Following any of the above steps it resolved my issue.

@TKTheTechie
Copy link

I'm having a similar issue whereby my jspm installs are failing behind proxy -

Error: tunneling socket could not be established, cause=write EPROTO 101057
ssl\s23_clnt.c:782:

         at ClientRequest.onError (c:\[path]\node_modules\jsp
js:174:17)
         at ClientRequest.g (events.js:199:16)
         at ClientRequest.emit (events.js:107:17)
         at TLSSocket.socketErrorListener (_http_client.js:271:9)
         at TLSSocket.emit (events.js:129:20)
         at onwriteError (_stream_writable.js:317:10)
         at onwrite (_stream_writable.js:335:5)
         at WritableState.onwrite (_stream_writable.js:105:5)
         at fireErrorCallbacks (net.js:456:13)
         at TLSSocket.Socket._destroy (net.js:495:3)

I've tried setting the http/s proxy env variables as described in the post but I still can't get around it. My jspm-github component is on version - 0.11.6

Any advice?

@JabX
Copy link

JabX commented Aug 7, 2015

Hi,
I have the same exact error messages that @capaj is getting on Windows behind my company's proxy.
npm install works, git clone works, but somehow jspm install fails.
I of course tried to set the env variables like everyone else.

Any ideas ?

@guybedford
Copy link
Member

I would love for someone to suggest what needs to be done here myself. I have no test cases for proxys, so find this very difficult to work on.

@uoloman
Copy link

uoloman commented Aug 31, 2015

Same issue. Doesn't work behind corporate proxy on windows 7. This is blocker in using jspm.

node -v
v0.12.7

npm -v
2.14.1

Trying to run http://aurelia.io/get-started.html example.

Neither "jspm install -y" or "jspm registry config github" works.
Files are getting downloaded properly with npm install command. Only failing with jspm.

proxy and https-proxy are correctly set in npm config (hence npm works proplery but not jspm).

Also, tried setting http_proxy and https_proxy in windows console as env variable but no luck.

@uoloman
Copy link

uoloman commented Aug 31, 2015

In case someone wants to know this is not being run with admin access.

error

jspm install -y

warn Running jspm globally, it is advisable to locally install jspm via npm install jspm --save-dev.
     Looking up npm:babel-core
     Looking up npm:babel-runtime
     Looking up npm:core-js

warn Using local override for npm:core-js@0.9.18
     Looking up npm:font-awesome
     Creating registry cache...

warn Error on locate for github:aurelia/animator-css, retrying (1).
     Error: getaddrinfo ENOTFOUND github.com
         at errnoException (dns.js:44:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)

warn Error on locate for github:aurelia/binding, retrying (1).
     Error: getaddrinfo ENOTFOUND github.com
         at errnoException (dns.js:44:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)
.
.
warn Error on lookup for npm:babel-core
     Error: getaddrinfo ENOTFOUND registry.npmjs.org
         at errnoException (dns.js:44:10)
         at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26)

err  Error looking up npm:babel-core.

@uoloman
Copy link

uoloman commented Aug 31, 2015

It worked only after adding HTTP_PROXY and HTTPS_PROXY as user environment variables. Earlier I was just setting those two variables on command prompt using following command which didn't work.

set HTTP_PROXY="" command

However after this I got following error

     Error: certificate not trusted
         at Error (native)

To resolve this error - set "strictSSL": false, in C:\Users\AppData\Local.jspm\config file
(mode detail - #725)

After which following command worked fine.

jspm registry config github

However, now I'm getting below error. Any idea how to fix it ? Thnx.

jspm install -y

warn Error on getOverride for jspm:npm
     Error: Command failed: C:\Windows\system32\cmd.exe /s /c "git fetch --all && git reset --hard origin/master"
     fatal: unable to access 'https://github.com/jspm/registry.git/': SSL certificate problem: unable to get local issuer certificate
     error: Could not fetch origin

         at ChildProcess.exithandler (child_process.js:751:12)
         at ChildProcess.emit (events.js:110:17)
         at maybeClose (child_process.js:1015:16)
         at Socket.<anonymous> (child_process.js:1183:11)
         at Socket.emit (events.js:107:17)
         at Pipe.close (net.js:485:12)

warn Error on getOverride for jspm:npm
     Error: Command failed: C:\Windows\system32\cmd.exe /s /c "git fetch --all && git reset --hard origin/master"
     fatal: unable to access 'https://github.com/jspm/registry.git/': SSL certificate problem: unable to get local issuer certificate
     error: Could not fetch origin

         at ChildProcess.exithandler (child_process.js:751:12)
         at ChildProcess.emit (events.js:110:17)
         at maybeClose (child_process.js:1015:16)
         at Socket.<anonymous> (child_process.js:1183:11)
         at Socket.emit (events.js:107:17)
         at Pipe.close (net.js:485:12)

warn Error on getOverride for jspm:npm
     Error: Command failed: C:\Windows\system32\cmd.exe /s /c "git fetch --all && git reset --hard origin/master"
     fatal: unable to access 'https://github.com/jspm/registry.git/': SSL certificate problem: unable to get local issuer certificate
     error: Could not fetch origin

         at ChildProcess.exithandler (child_process.js:751:12)
         at ChildProcess.emit (events.js:110:17)
         at maybeClose (child_process.js:1015:16)
         at Socket.<anonymous> (child_process.js:1183:11)
         at Socket.emit (events.js:107:17)
         at Pipe.close (net.js:485:12)

@smialy
Copy link

smialy commented Nov 2, 2015

I have some problem with proxy too. After run:

jspm install 

I have:

Error: fatal: unable to access 'systemjs/plugin-text.git/': Could not resolve host: github.com

How I fixed it?
I've removed next three line: https://github.com/jspm/github/blob/0.13.7/github.js#L113 - :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests