cli icon indicating copy to clipboard operation
cli copied to clipboard

[BUG] Exit handler never called in Docker container with node v25.2.1, npm v11.6.2

Open eirikhanasand opened this issue 1 month ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues (there are similar issues for previous versions, but not for node 25 or the later npm versions)

This issue exists in the latest npm version

  • [x] I am using the latest npm

Current Behavior

The npm install fails stating that the exit handler was never called, and that this is an error with npm itself and that the issue should be reported here. I have attached the debug log at the bottom.

Expected Behavior

The exit handler to be called and the install to complete successfully.

Steps To Reproduce

  1. Im using the following files: Dockerfile
FROM node:alpine
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci # (also fails with npm install instead of npm ci)
COPY . .
CMD npm start

package.json

"dependencies": {
    "dotenv": "^17.2.3",
    "firebase-admin": "^13.6.0",
    "node-cron": "^4.2.1"
},
"devDependencies": {
    "@types/node": "^24.10.1",
    "@types/node-cron": "^3.0.11",
    "typescript": "^5.9.3"
},
  1. Build the Docker container
  2. The build will fail and you will be presented with the error.

Environment

  • npm: v11.6.2
  • Node.js: v25.2.
  • OS Name: Linux 6.8.0-87-generic (ubuntu 24.01 LTS)
  • System Model Name: ubuntu
  • npm config:
; node bin location = /home/dev/.nvm/versions/node/v25.2.1/bin/node
; node version = v25.2.1
; npm local prefix = /home/dev/nucleus-notifications
; npm version = 11.6.2
; cwd = /home/dev/nucleus-notifications
; HOME = /home/dev
; Run `npm config ls -l` to show all defaults.

Debug log attached.

debug.log

eirikhanasand avatar Nov 20 '25 21:11 eirikhanasand

node:alpine
node:lts-alpine
node:24-alpine
node:23.11.1-alpine (last patch of 23)
node:23-alpine
node:22-alpine (v22.21.1 / npm v10.9.4)
node:slim
node:24-slim

tried the following versions, none of which fixed it

eirikhanasand avatar Nov 20 '25 21:11 eirikhanasand

Tried removing all packages from my Dockerfile, and it seems to be independant of packages. Even with no deps and just one dev depencency it happened. Tested with @types/node (latest version), and then with dotenv (latest version) and still got the same issue.

eirikhanasand avatar Nov 20 '25 22:11 eirikhanasand