Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm error Exit handler never called! #7639

Closed
2 tasks done
SxMAbel opened this issue Jul 11, 2024 · 11 comments
Closed
2 tasks done

[BUG] npm error Exit handler never called! #7639

SxMAbel opened this issue Jul 11, 2024 · 11 comments
Labels
Bug thing that needs fixing Needs Triage needs review for next steps

Comments

@SxMAbel
Copy link

SxMAbel commented Jul 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

1.648 npm warn using --force Recommended protections disabled.
152.0 npm error Exit handler never called!
152.0 npm error This is an error with npm itself. Please report this error at:
152.0 npm error https://github.com/npm/cli/issues
152.0
152.1
152.1 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-11T01_38_27_566Z-debug-0.log

Expected Behavior

expected to build docker image but throws that error when it gets to npm install.

Use the official Node.js image as a base

FROM node:18.20.4

Set the working directory

WORKDIR /home/nick/backend

Install app dependencies

COPY package*.json ./
RUN npm install

Copy the rest of the application code

COPY . .

Build the TypeScript code

RUN npm run build

Expose the port the app runs on

EXPOSE 35001

Command to run the app

CMD ["node", "dist/index.js"]

Steps To Reproduce

No response

Environment

  • npm: 10.8.2
  • Node.js: 18.20.4
  • OS Name: Ubuntu 22.04.4 LTS
  • System Model Name: Server
  • npm config:
; node bin location = /root/.nvm/versions/node/v18.20.4/bin/node
; node version = v18.20.4
; npm local prefix = /home/nick/backend
; npm version = 10.8.2
; cwd = /home/nick/backend
; HOME = /root
@SxMAbel SxMAbel added Bug thing that needs fixing Needs Triage needs review for next steps labels Jul 11, 2024
@SxMAbel
Copy link
Author

SxMAbel commented Jul 11, 2024

 => [2/6] WORKDIR /home/nick/backend                                                                                                                                    11.2s
 => [3/6] COPY package*.json ./                                                                                                                                          0.5s
 => ERROR [4/6] RUN npm install                                                                                                                                        444.5s
------                                                                                                                                                                        
 > [4/6] RUN npm install:                                                                                                                                                     
443.7 npm error Exit handler never called!                                                                                                                                    
443.7 npm error This is an error with npm itself. Please report this error at:                                                                                                
443.7 npm error     <https://github.com/npm/cli/issues>
443.7 
443.7 
443.7 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-11T01_54_36_226Z-debug-0.log
------
Dockerfile:9
--------------------
   7 |     # Install app dependencies
   8 |     COPY package*.json ./
   9 | >>> RUN npm install
  10 |     
  11 |     # Copy the rest of the application code
--------------------
ERROR: failed to solve: process "/bin/sh -c npm install" did not complete successfully: exit code: 1

@milaninfy
Copy link
Contributor

this error can arise for a number of reasons; Please read this document & provide as much information as possible if you're able to consistently reproduce this error. Please includes things like package.json, lock file if exists, logs, steps to reproduce etc.

alexgarel pushed a commit to openfoodfacts/openfoodfacts-server that referenced this issue Jul 11, 2024
…10536)

Frontend docker container build fails with new npm:latest (20.15.1) version. 
See npm/cli#7639

This PR set the version to the previous 20.15.0 until it's fixed.

--
Co-authored-by: Alex Garel <alex@garel.org>
@ROD-MASAMI
Copy link

i get this error too anyone with a solution

@knolleary
Copy link

We are hitting this with our Node 22 CI builds (as 22 now include npm 10.8.2). I appreciate root cause could be completely different to the OP issue, but the timing is suspicious as the failures have only started with 10.8.2.

It fails with the following package file: https://github.com/node-red/node-red/blob/a1bf270ba6ba542b35b53447807801ce85b6d147/package.json

I'll see if I can narrow it down further.

@milaninfy
Copy link
Contributor

for which exact node version it's failing ? if you are using 22.5.0 and npm(10.8.2) and it's failing, could you please try with 22.4.1 and npm 10.8.2 if possible?
This looks like similer to #7657

@knolleary
Copy link

After commenting, I dug around and found the linked issue, including the one in the node repo. Looks like plenty of eyes are on it and not much I can usefully add - so will avoid generating any more noise. But I can confirm the install works with 22.4.1 and npm 10.8.2.

@steven-so
Copy link

I started running into this issue in our docker build sometime in the last week.

These are the versions I was running when it happened:
node: v22.5.0
npm: 10.8.2

@avivkeller
Copy link

This issue is being tracked at #7657 and is caused by nodejs/node#53902.

@avivkeller
Copy link

If you are curious on the progress to a solution, it is being discussed on Slack at https://openjs-foundation.slack.com/archives/CTEDKHCTB/p1721324768673819

@milaninfy
Copy link
Contributor

Fixed in Node.js v22.5.1 nodejs/node#53902 (comment)

@zhibirc
Copy link

zhibirc commented Jul 24, 2024

Are there any solutions for Node.js v18.20.4 for that matter? Because initially bug was reported for this version. I have the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps
Projects
None yet
Development

No branches or pull requests

7 participants