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

[BUG] npm install fails to resolve proxy server address #2516

Open
wpwoodjr opened this issue Jan 20, 2021 · 3 comments
Open

[BUG] npm install fails to resolve proxy server address #2516

wpwoodjr opened this issue Jan 20, 2021 · 3 comments
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@wpwoodjr
Copy link

wpwoodjr commented Jan 20, 2021

Current Behavior:

In npm 6, npm install works behind a proxy when the http_proxy and https_proxy environment variables are set.

npm 7 fails with:

#9 [5/5] RUN npm install
#9 6.650 npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
#9 11.04 npm ERR! code ENOTFOUND
#9 11.04 npm ERR! syscall getaddrinfo
#9 11.04 npm ERR! errno ENOTFOUND
#9 11.04 npm ERR! network request to https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz failed, reason: getaddrinfo ENOTFOUND xxx.proxy.corp.com
#9 11.04 npm ERR! network This is a problem related to network connectivity.
#9 11.04 npm ERR! network In most cases you are behind a proxy or have bad network settings.
#9 11.04 npm ERR! network
#9 11.04 npm ERR! network If you are behind a proxy, please make sure that the
#9 11.05 npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
#9 11.06
#9 11.06 npm ERR! A complete log of this run can be found in:
#9 11.06 npm ERR!     /root/.npm/_logs/2021-01-20T23_07_32_036Z-debug.log
#9 ERROR: executor failed running [/bin/sh -c npm install]: runc did not terminate sucessfully

If I replace the proxy DNS name with its IP address, it works fine, so it seems to be a bug in proxy DNS name resolution.

Expected Behavior:

It works fine in npm 6 using the proxy DNS name (no IP address required):

#8 [4/4] RUN npm install
#8 5.827 npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
#8 15.08
#8 15.08 > [email protected] postinstall /usr/src/app/node_modules/core-js
#8 15.08 > node -e "try{require('./postinstall')}catch(e){}"
#8 15.08
#8 15.13 Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
#8 15.13
#8 15.13 The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
#8 15.13 > https://opencollective.com/core-js
#8 15.13 > https://www.patreon.com/zloirock
#8 15.13
#8 15.13 Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
#8 15.13
#8 15.25 npm notice created a lockfile as package-lock.json. You should commit this file.
#8 15.26 added 134 packages from 82 contributors and audited 135 packages in 14.626s
#8 15.32
#8 15.32 2 packages are looking for funding
#8 15.32   run `npm fund` for details
#8 15.32
#8 15.32 found 0 vulnerabilities
#8 15.32
#8 DONE 15.5s

Environment:

  • OS: node:lts-alpine and node:current-alpine in Docker 19.03.13
  • npm: 6.14.10 and 7.4.2
@wpwoodjr wpwoodjr added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jan 20, 2021
@darcyclarke
Copy link
Contributor

@wpwoodjr can you try the latest v7 & see if you're still experiencing this issue? (ie. npm i -g npm@7) We've recently shipped some fixes that should deal with this.

@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Feb 2, 2021
@49-22
Copy link

49-22 commented Mar 30, 2022

This seems to be the case still.
Recently we tried to bump the version of node from 14 to 16 (npm 6 to 8) and we started seeing similar failures.

any proper fix?

@tonyvargese
Copy link

Proxy Configuration Check:
Even if your device doesn't have a set proxy, sometimes npm might still try to use proxy configurations from environment variables or system settings. You can explicitly tell npm not to use a proxy by running:

npm config delete proxy
npm config delete https-proxy

This will remove any proxy settings that might be interfering with npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants