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 not working behind a proxy in docker (16.7+) #3561

Closed
bujinin opened this issue Sep 29, 2021 · 4 comments
Closed

npm not working behind a proxy in docker (16.7+) #3561

bujinin opened this issue Sep 29, 2021 · 4 comments
Labels

Comments

@bujinin
Copy link

bujinin commented Sep 29, 2021

Version

16.7+

Platform

Docker 20.10.7 on Linux 4.15.0-158-generic nodejs/node#166-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

I'm trying to build a node-app in docker with the following Dockerfile

FROM node:16.7 as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
...

Building the app (docker build -t app:test .) results in an error.

How often does it reproduce? Is there a required condition?

For every node-image v16.7+. In 16.6 and lower, everything works fine

What is the expected behavior?

Install the dependencies

What do you see instead?

npm WARN deprecated @types/localforage@0.0.34: This is a stub types definition for localforage (https://github.com/localForage/localForage). localforage provides its own type definitions, so you don't need @types/localforage installed!
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated xmldom@0.3.0: Deprecated due to CVE-2021-21366 resolved in 0.5.0
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm notice 
npm notice New minor version of npm available! 7.20.3 -> 7.24.1
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.24.1>
npm notice Run `npm install -g npm@7.24.1` to update!
npm notice 
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno -104
npm ERR! network read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-09-29T14_01_17_394Z-debug.log

Additional information

Proxy is properly set for the docker client and for the daemon and work correctly (tested in multiple other containers/apps).
When trying to run a container manually (docker run -it --rm node:16.7 /bin/bash) and reproduce the steps , everything works fine.

@benjamingr benjamingr transferred this issue from nodejs/node Oct 4, 2021
@MichaelVoegele
Copy link

Hey there

We are hitting this issue as well, we are getting exact same error:

npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno -104
npm ERR! network read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /opt/app-root/src/.npm/_logs/2022-06-14T05_32_59_842Z-debug.log

We are using node v16.14.0 and we are running behind a proxy. The issue is appearing randomly, sometimes it works, sometimes it doesn't.

Is this a confirmed issue? Is it being addressed?

Any update or hint is welcome.

Regards
Michael

@jonathan-a-you
Copy link

Hello,

I also have the same issue on OpenShift behind a proxy (that is correctly set).

I tried several version of nodejs (16.14.0 // 16.6.2 // 16.6.0 // 16.15.1) and of npm (8.12.2 // 8.3.1 // 8.5.2), but no luck. Sometimes it works, sometimes not... And when it fails, it's always at a different package download.

Is there anything we can do?

Thanks,
Jonathan

Copy link

github-actions bot commented May 8, 2024

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot added the stale label May 8, 2024
Copy link

github-actions bot commented Jun 7, 2024

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment.
If you need further assistance or have questions, you can also search for similar issues on Stack Overflow.
Make sure to look at the README file for the most updated links.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants