Skip to content

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

@eirikhanasand

Description

@eirikhanasand

Is there an existing issue for this?

  • 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

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions