-
-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Closed
Labels
Description
Simple test application generated with npm init and npm install
{
"name": "psvo",
"version": "1.0.0",
"description": "SPA Example",
"license": "ISC",
"author": "",
"type": "module",
"main": "index.js",
"scripts": {
},
"dependencies": {
"express": "^5.1.0"
}
}
In Dockerfile
FROM node:22-alpine
WORKDIR /app
COPY package*.json .
RUN npm install --no-update-notifier
EXPOSE 80
CMD ["npm", "start"]
In docker compose
services:
psvo-dev:
container_name: psvo-dev
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- /app/node_modules
When running docker compose build, npm install runs for a few minutes and issues the following error:
usuario@server:~/ecosistema1/services/psvo$ docker compose build
[+] Building 148.2s (9/9) FINISHED
=> [internal] load local bake definitions 0.0s
=> => reading from stdin 537B 0.0s
=> [internal] load build definition from Dockerfile.dev 0.0s
=> => transferring dockerfile: 207B 0.0s
=> [internal] load metadata for docker.io/library/node:22-alpine 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [1/4] FROM docker.io/library/node:22-alpine 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 72B 0.0s
=> CACHED [2/4] WORKDIR /app 0.0s
=> [3/4] COPY package*.json . 0.2s
=> ERROR [4/4] RUN npm install --no-update-notifier 147.2s
------
> [4/4] RUN npm install --no-update-notifier:
146.5 npm error Exit handler never called!
146.5 npm error This is an error with npm itself. Please report this error at:
146.5 npm error <https://github.com/npm/cli/issues>
146.5 npm error A complete log of this run can be found in: /root/.npm/_logs/2025-09-16T16_05_37_926Z-debug-0.log
------
Dockerfile.dev:7
--------------------
5 | # instalando para construir o ambiente
6 | COPY package*.json .
7 | >>> RUN npm install --no-update-notifier
8 |
9 | EXPOSE 80
--------------------
failed to solve: process "/bin/sh -c npm install --no-update-notifier" did not complete successfully: exit code: 1
Reactions are currently unavailable