Giter Site home page Giter Site logo

jspm install fails behind proxy about jspm-cli HOT 67 CLOSED

yeban avatar yeban commented on August 15, 2024
jspm install fails behind proxy

from jspm-cli.

Comments (67)

tauren avatar tauren commented on August 15, 2024 1

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/[email protected]
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.

from jspm-cli.

uoloman avatar uoloman commented on August 15, 2024 1

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

"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.

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

jspm install github:components/[email protected] throws the same error.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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

     Getting version list for github:components/jquery
     Downloading github:components/[email protected]
[error] connect ECONNREFUSED null components
     Checking github:components/[email protected] 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)

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

Now I get:

     Getting version list for github:components/jquery
     Downloading github:components/[email protected]
[error] connect ECONNREFUSED null components
     Checking github:components/[email protected] 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?

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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?

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

Yup. If I have https_proxy environment variable exported.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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

If you can post a patch that would be great!

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

Thanks for letting me know - no problem at all.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

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?

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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?

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

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.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

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?

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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?

from jspm-cli.

yeban avatar yeban commented on August 15, 2024

@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?

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

That's why I think we should leave it to endpoints to handle their own proxying, as they are more aware of their own constraints.

Surely we can just pass the endpoint options proxy (uri) and noproxy (ip:port array), and then let the endpoint do the rest?

Also we should stick with https as default, I don't see why we need to support http. The --https option means port 443 over other alternative ports which may not be open, as opposed to https instead of http.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

I've made some progress adding proxy support. I've converted the jspm modules from https to request and have certain things working behind my proxy.

However, now I'm running into issues with the ajaxorg node-github package that is used by the jspm-github package. Still working through some issues, but hope to have this all committed in the next day or two. Once I feel it is solid, I'll submit a pull request.

Also, I noticed that request appears to check env variables, but doesn't honor NO_PROXY, Unfortunately, it was not working for me. It would only proxy by adding a proxy properties to the options passed, but I didn't mess with it too much.
https://github.com/mikeal/request/blob/master/request.js#L149-L157

I created a small helper that can wrap around a requestObject that is passed to request:
https://www.npmjs.org/package/request-proxy-helper

var proxyHelper = require('request-proxy-helper');
request(proxyHelper({
  uri: 'http://foo.com/'
}, proxyConfig).on(...);

It will add a proxy property based on jspm config proxy settings or env vars, and take into account the noproxy settings as well. Not sure if it is the best solution, but it is an external package that endpoints can depend upon as well without creating any tight coupling.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

Great, I look forward to seeing this work soon!

For the proxy helper, did you have a look at request/request#469 (comment). Does it make sense what he says about redirect events here?

Also, did you update the version of request when checking if it was accessing the proxy variables? It would be nice to have a thread to follow this work into request core, and not need the intermediate dependency.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

Also a heads up - I will be working on updating the endpoint API over the next few days. It will be simple changes like moving entirely to promises, changing getVersions to lookup etc. I will keep you informed and it will only apply to the current beta release, so hopefully we can avoid conflicts.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

This PR adds automatic proxy support to jspm-cli:
#100

It uses request for communication instead of https.get. By using request, proxy environment variables are automatically used. However, at this time, no_proxy support is not included. It looks like the 3.0 version of request may include no_proxy support:
request/request#853

Note that this PR only fixes jspm-cli. The endpoint jspm-github also needs to be updated. The jspm-npm may need updating as well.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

The latest beta release should now support proxies, but I haven't been able to test this yet. Please do let me know if you notice any issues.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

Great! I won't be at the office again until Monday, but I'll certainly give it a try.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

I believe the proxy support is working now? Please let me know if there are any issues with this at all.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

Yes, proxy support is working. Unfortunately, until request/request#853 is resolved, things aren't optimal since no_proxy is not supported.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

Thanks for letting me know. It looks like that is in request 2.45 now so that all is needed is an update for that?

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

Oh cool, I didn't know someone had fixed it! Assuming request/request#1096 is included in 2.45, then yes it would be great to bump the version of request in jspm-cli.

Now I need to see if I can get npm updated to include it as well. Looks like it is still using 2.44:
https://github.com/npm/npm/blob/master/package.json

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

I checked and it definitely is included in 2.45. Will update this side too.

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

Has this been resolved?

jspm install is not working for me, I have $http_proxy and $https_proxy values in the env (and their uppercase kin).

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

@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.

from jspm-cli.

tauren avatar tauren commented on August 15, 2024

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 [email protected] 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).

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

@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?

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

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

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

@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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

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

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

@faceleg thanks for letting me know.

The next three things to check are:

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

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

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

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.

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

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

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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

from jspm-cli.

faceleg avatar faceleg commented on August 15, 2024

Cool. I guess re-close this then

from jspm-cli.

sylvainpolletvillard avatar sylvainpolletvillard commented on August 15, 2024

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

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

sylvainpolletvillard avatar sylvainpolletvillard commented on August 15, 2024

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.

from jspm-cli.

capaj avatar capaj commented on August 15, 2024

@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:[email protected]:8080
git config --global https.proxy https://proxyuser:[email protected]: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.

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

@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.

from jspm-cli.

IcodeNet avatar IcodeNet commented on August 15, 2024

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.

from jspm-cli.

TKTheTechie avatar TKTheTechie commented on August 15, 2024

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?

from jspm-cli.

JabX avatar JabX commented on August 15, 2024

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 ?

from jspm-cli.

guybedford avatar guybedford commented on August 15, 2024

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.

from jspm-cli.

uoloman avatar uoloman commented on August 15, 2024

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:[email protected]
     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.

from jspm-cli.

uoloman avatar uoloman commented on August 15, 2024

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)

from jspm-cli.

smialy avatar smialy commented on August 15, 2024

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 - :(

from jspm-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.