# "npm ci" error while "docker compose build --no-cache" processing

**URL:** <https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876>\
**Category:** Image Builds\
**Created:** [July 18, 2025, 1:30pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876 "2025-07-18T13:30:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![victorgen](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/victorgen/32/54582_2.png) [@victorgen](https://forums.docker.com/u/victorgen)\
**Post date:** [July 18, 2025, 1:30pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/1 "2025-07-18T13:30:04Z")

</div>

Hi.  
There is host OS windows 10 hyper-v and guest OS Ubuntu 20.04. On Ubuntu has installed docker engine Version:28.3.2.  
There is a complex docker configuration. If build it via “docker compose build --no-cache”, then processing dockerfile

```auto
FROM node:20.11.0
ARG ENV_FILE
WORKDIR /app
ADD package.json /app/package.json
ADD package-lock.json /app/package-lock.json
COPY ${ENV_FILE} /app/deploy.env
RUN echo "token :$GITLAB_DEPLOY_TOKEN"

RUN export $(grep -v '^#' /app/deploy.env | xargs) && npm config set -- "//<site name>/api/v4/projects/58/packages/npm/:_authToken=${GITLAB_DEPLOY_TOKEN}"
RUN npm ci --cache .npm --prefer-offline

```

produce errors:

```auto
=> ERROR [client 8/10] RUN npm ci --cache .npm --prefer-offline 13.6s
------ > [client 8/10] RUN npm ci --cache .npm --prefer-offline:                                                                                                                                                 
13.11 npm notice                                                                                                                                                                                            
13.11 npm notice New major version of npm available! 10.2.4 -> 11.4.2                                                                                                                                       
13.11 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v11.4.2>                                                                                                                               
13.11 npm notice Run `npm install -g npm@11.4.2` to update!                                                                                                                                                 
13.11 npm notice                                                                                                                                                                                            
13.11 npm ERR! code ECONNRESET                                                                                                                                                                              
13.11 npm ERR! syscall read                                                                                                                                                                                 
13.11 npm ERR! errno -104                                                                                                                                                                                   
13.11 npm ERR! network read ECONNRESET                                                                                                                                                                      
13.11 npm ERR! network This is a problem related to network connectivity.                                                                                                                                   
13.11 npm ERR! network In most cases you are behind a proxy or have bad network settings.                                                                                                                   
13.11 npm ERR! network                                                                                                                                                                                      
13.11 npm ERR! network If you are behind a proxy, please make sure that the                                                                                                                                 
13.11 npm ERR! network 'proxy' config is set properly. See: 'npm help config'                                                                                                                              
13.13 
13.13 npm ERR! A complete log of this run can be found in: /app/.npm/_logs/2025-07-18T12_56_35_177Z-debug-0.log

```

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [July 18, 2025, 6:22pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/2 "2025-07-18T18:22:56Z")

</div>

> [@victorgen](#):
>
> ```auto
> 13.11 npm ERR! network read ECONNRESET                                                                                                                                                                      
> 13.11 npm ERR! network This is a problem related to network connectivity.                                                                                                                                   
> 13.11 npm ERR! network In most cases you are behind a proxy or have bad network settings.                                                                                                                   
> 13.11 npm ERR! network                                                                                                                                                                                      
> 13.11 npm ERR! network If you are behind a proxy, please make sure that the                                                                                                                                 
> 13.11 npm ERR! network 'proxy' config is set properly. See: 'npm help config' 
> 
> ```

This looks like you have restricted network connectivity (as in requires a http proxy to be configured), or the way you configure the auth token is wrong.

The first one is easy to test: just add a `RUN apt update` somewhere in your Dockerfile (of course in a line before the line that throws the error).

---

<div class="post-metadata">

**Author:** ![victorgen](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/victorgen/32/54582_2.png) [@victorgen](https://forums.docker.com/u/victorgen)\
**Post date:** [July 19, 2025, 8:17pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/3 "2025-07-19T20:17:42Z")

</div>

RUN apt update works successfully

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [July 19, 2025, 8:40pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/4 "2025-07-19T20:40:39Z")

</div>

Then it could be an npm config somewhere. I read that npm config files can contain proxy settings that people forgot about.

I would also check if the URL set in the second to last step is correct. Or if you need any variable set in that step later as nothing will be available in the npm cli layer that you export in the previous layer.

---

<div class="post-metadata">

**Author:** ![meyay](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/meyay/32/34000_2.png) [@meyay](https://forums.docker.com/u/meyay)\
**Post date:** [July 20, 2025, 11:17am UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/5 "2025-07-20T11:17:59Z")

</div>

> [@victorgen](#):
>
> ```auto
> RUN export $(grep -v '^#' /app/deploy.env | xargs) && npm config set -- "//<site name>/api/v4/projects/58/packages/npm/:_authToken=${GITLAB_DEPLOY_TOKEN}"
> 
> ```

Is it safe to assume that `<site name>` is just a placeholder, and that you actually tested the effect of the command in an isolated environment (e.g. as in a fresh clone of your project in a different folder on your dev machine)?

According to the [Gitlab docs](https://docs.gitlab.com/user/packages/npm_registry/?tab=For+an+instance#with-npm-config-set) the url to be used in the `npm config set` command depend s on the npm version.

---

<div class="post-metadata">

**Author:** ![victorgen](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/victorgen/32/54582_2.png) [@victorgen](https://forums.docker.com/u/victorgen)\
**Post date:** [July 20, 2025, 9:30pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/6 "2025-07-20T21:30:40Z")

</div>

Yes, is the name of the site from which npm downloads packages.  
For testing, I installed Ubuntu as a second OS on a computer with a guest Ubuntu, and under this OS, docker and npm worked without errors. The error only appears on the Ubuntu, installed as guest OS on hyper-v.

---

<div class="post-metadata">

**Author:** ![rimelek](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/rimelek/32/41602_2.png) [@rimelek](https://forums.docker.com/u/rimelek)\
**Post date:** [July 22, 2025, 7:49pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/7 "2025-07-22T19:49:42Z")

</div>

I don’t see how the type of virtualization could cause the issue unless the image you could use on HyperV was different containing different default packages.

By the way I read that Docker dropped the Ubuntu 20.04 packages for Docker as Ubuntu 20.04 reached EOL.

> <https://github.com/docker/docker-ce-packaging/pull/1200>
>
> Ubuntu 20.04 reached end of support on April 30. There's still commercial ESM (E…xtended Security Maintenance) support, but we don't account for that in our packages; https://ubuntu.com/blog/ubuntu-20-04-eol-for-devicesional
> 
> 
> \*\*- Description for the changelog\*\*
> 
> 
> \`\`\`markdown changelog
> Drop Ubuntu 20.04 "Focal" packages as it reached end of life.
> \`\`\`
> 
> 
> \*\*- A picture of a cute animal (not mandatory but encouraged)\*\*

There is no Docker CE 28.3.2 here:

> **[Index of linux/ubuntu/dists/focal/pool/stable/amd64/](https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/)**

So how did you install that version? Is it installed from a non-official source like Ubuntu’s own repository (`docker.io`) or from snap?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/docker/original/3X/d/4/d4fbccd46c81bfcffe9822e20e17736d946fa821.png) [@system](https://forums.docker.com/u/system)\
**Post date:** [August 22, 2025, 8:17pm UTC](https://forums.docker.com/t/npm-ci-error-while-docker-compose-build-no-cache-processing/148876/9 "2025-08-22T20:17:18Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
