I’m trying to dockerize Vue.js app and to do so, I wrote simple Dockerfile:
<code>FROM node:19.5.0-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm cache clean --force
RUN npm cache verify
RUN npm install
COPY . .
RUN npm run build
</code>
<code>FROM node:19.5.0-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm cache clean --force
RUN npm cache verify
RUN npm install
COPY . .
RUN npm run build
</code>
FROM node:19.5.0-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm cache clean --force
RUN npm cache verify
RUN npm install
COPY . .
RUN npm run build
But then I got an error:
<code> => ERROR [6/8] RUN npm install 141.2s
------
> [6/8] RUN npm install:
141.1 npm error Exit handler never called!
141.1 npm error This is an error with npm itself. Please report this error at:
141.1 npm error <https://github.com/npm/cli/issues>
141.2
141.2
141.2 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-02T11_50_11_753Z-debug-0.log
------
Dockerfile:7
--------------------
5 | RUN npm cache clean --force
6 | RUN npm cache verify
7 | >>> RUN npm install
8 | COPY . .
9 | RUN npm run build
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1
</code>
<code> => ERROR [6/8] RUN npm install 141.2s
------
> [6/8] RUN npm install:
141.1 npm error Exit handler never called!
141.1 npm error This is an error with npm itself. Please report this error at:
141.1 npm error <https://github.com/npm/cli/issues>
141.2
141.2
141.2 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-02T11_50_11_753Z-debug-0.log
------
Dockerfile:7
--------------------
5 | RUN npm cache clean --force
6 | RUN npm cache verify
7 | >>> RUN npm install
8 | COPY . .
9 | RUN npm run build
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1
</code>
=> ERROR [6/8] RUN npm install 141.2s
------
> [6/8] RUN npm install:
141.1 npm error Exit handler never called!
141.1 npm error This is an error with npm itself. Please report this error at:
141.1 npm error <https://github.com/npm/cli/issues>
141.2
141.2
141.2 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-06-02T11_50_11_753Z-debug-0.log
------
Dockerfile:7
--------------------
5 | RUN npm cache clean --force
6 | RUN npm cache verify
7 | >>> RUN npm install
8 | COPY . .
9 | RUN npm run build
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1
I googled a lot before asking, and nothing helped, nor verifying cach, nor forcing cache cleaning.