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

NPM Install fails behind corporate proxy #11718

Open
njneer opened this issue Oct 25, 2021 · 6 comments · Fixed by #12149
Open

NPM Install fails behind corporate proxy #11718

njneer opened this issue Oct 25, 2021 · 6 comments · Fixed by #12149

Comments

@njneer
Copy link

njneer commented Oct 25, 2021

Version: 2.4
OS: Windows 10 64-bit
Expected behavior: Npm install should respect proxy environment variables
Actual behavior: While NPM packages successfully install, the installer runs a node script to download meteor distribution: node cli.js install; this node script does not use the proxy environment variables set for npm, so meteor installer never installs, hangs at 0%
How to reproduce: Sit behind proxy, set proxy variables and run npm install -g meteor

Thanks

@NicoP-S
Copy link

NicoP-S commented Nov 5, 2021

having the same problem on an debian server.
system & npm proxy is set.

The cli.js requires the install.js
And thisone seems to use the node-downloader-helper
https://github.com/meteor/meteor/blob/devel/npm-packages/meteor-installer/install.js#L105

I did't find anything proxy releated to the downloaderHelper

@renanccastro
Copy link
Contributor

Hello!

this node script does not use the proxy environment variables set for npm

Can you describe more which env vars are you referring to? How are you using a proxy with npm?

@NicoP-S
Copy link

NicoP-S commented Jan 11, 2022

Hi @renanccastro
i can share my proxy issue which seems to be the same problem .

env |grep proxy

https_proxy=http://MYPROXYSERVER:3128
http_proxy=http://MYPROXYSERVER:3128

npm config list

...
http-proxy = "http://MYPROXYSERVER:3128/"
https-proxy = "http://MYPROXYSERVER:3128/"
proxy = "http://MYPROXYSERVER:3128/"
...

Error which ignores proxy and tries a direct connection to 3.225.194.45

npm install -g meteor
/usr/bin/meteor-installer -> /usr/lib/node_modules/meteor/cli.js

> meteor@2.5.4 install /usr/lib/node_modules/meteor
> node cli.js install

You are running the install script as root, without SUDO. This is not recommended and should be avoided. Continuing.
Downloading |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░| 0%/usr/lib/node_modules/meteor/install.js:43
  throw err;
  ^

Error: connect ECONNREFUSED 3.225.194.45:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
Emitted 'error' event on b instance at:
    at /usr/lib/node_modules/meteor/node_modules/node-downloader-helper/dist/index.js:1:10036
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '3.225.194.45',
  port: 443
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor@2.5.4 install: `node cli.js install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor@2.5.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@yanickrochon
Copy link

I'm not sure if this is relevant, here, but I found that when I started using Meteor, a few years ago, that there's a difference between npm install and meteor npm install. The latter should be used.

In short, instead of npm config list, run meteor npm config list.

@NicoP-S
Copy link

NicoP-S commented Jan 12, 2022

the meteor command does not exist. The error above occours while installing meteor

https://docs.meteor.com/install.html#installation

npm install -g meteor

@yanickrochon
Copy link

yanickrochon commented Jan 12, 2022

My bad. Then the problem isn't npm, but the install.js script, which uses node-downloader-helper module; it ignores proxy settings.

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

Successfully merging a pull request may close this issue.

5 participants