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] Exit handler never called on npm ci #7666

Closed
2 tasks done
TobiasBabin opened this issue Jul 19, 2024 · 23 comments
Closed
2 tasks done

[BUG] Exit handler never called on npm ci #7666

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

Comments

@TobiasBabin
Copy link

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

I'm seeing this output in our Docker build in the step RUN npm ci:

#12 [base-build 4/5] RUN npm ci
#12 7.165 npm error Exit handler never called!
#12 7.165 npm error This is an error with npm itself. Please report this error at:
#12 7.165 npm error   <https://github.com/npm/cli/issues>
#12 7.166 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-19T06_11_36_243Z-debug-0.log

Expected Behavior

RUN npm ci completes successfully and Docker build continues

Steps To Reproduce

Our Dockerfile up to this point:

FROM node:slim as base-build

COPY package.json package-lock.json /site/

WORKDIR /site

RUN npm ci

Extract of package.json:

{
  ..
  "engines": {
    "node": ">=16.16.0"
  },
  ..

Then run docker build -t some-tag .

Environment

  • OS Name: Ubuntu 22.04.4 (GitHub runner)

Output of npm config ls:

#10 0.500 ; node bin location = /usr/local/bin/node
#10 0.500 ; node version = v22.5.0
#10 0.500 ; npm local prefix = /site
#10 0.500 ; npm version = 10.8.2
#10 0.500 ; cwd = /site
#10 0.500 ; HOME = /root
@TobiasBabin TobiasBabin added Bug thing that needs fixing Needs Triage needs review for next steps labels Jul 19, 2024
@Bramw2003
Copy link

This also happens when running npm install with the latest version

@SquirrelDeveloper
Copy link

SquirrelDeveloper commented Jul 19, 2024

Got the same issue suddenly in github actions

@poldixd
Copy link

poldixd commented Jul 19, 2024

Same issue here:

$ npm ci
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-07-19T07_12_14_[34](https://XXXXXXXXX)7Z-debug-0.log
$ npm run build
> build
> vite build
sh: 1: vite: not found

Using Gitlab Runner 17.2.0 on a self hosted instance with docker image node:22.

@pietrykovsky
Copy link

same here

workflow config

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Use Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '22.x'

    - name: Install dependencies
      run: npm ci

    - name: Run linter
      run: npm run lint

package.json

{
  "name": "portfolio",
  "version": "1.3.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@tsparticles/react": "^3.0.0",
    "@tsparticles/slim": "^3.4.0",
    "bootstrap": "^5.3.3",
    "next": "14.2.4",
    "next-intl": "^3.15.3",
    "nodemailer": "^6.9.14",
    "react": "^18",
    "react-bootstrap": "^2.10.3",
    "react-dom": "^18",
    "react-google-recaptcha": "^3.1.0",
    "react-icons": "^5.2.1",
    "react-pdf": "^9.1.0",
    "typewriter-effect": "^2.21.0"
  },
  "devDependencies": {
    "eslint": "^8",
    "eslint-config-next": "14.2.4"
  }
}

Install dependencies step:

Run npm ci
  
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v[4](https://github.com/pietrykovsky/portfolio/actions/runs/10004105702/job/27652183338?pr=14#step:4:4) are no longer supported
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.1[4](https://github.com/pietrykovsky/portfolio/actions/runs/10004105702/job/27652183338?pr=14#step:4:5): Use @eslint/config-array instead
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error   <https://github.com/npm/cli/issues>
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-07-19T07_12_1[5](https://github.com/pietrykovsky/portfolio/actions/runs/10004105702/job/27652183338?pr=14#step:4:6)_242Z-debug-0.log

Run linter step:

Run npm run lint
  npm run lint
  shell: /usr/bin/bash -e {0}
  
> portfolio@1.3.0 lint
> next lint
sh: 1: next: not found
Error: Process completed with exit code 1[2](https://github.com/pietrykovsky/portfolio/actions/runs/10004105702/job/27652183338?pr=14#step:5:2)7.

@tanusharma10
Copy link

Same issue we are facing, any work around?

@IgorOhrimenko
Copy link

Yes, just replace from node:22 to node:22.4.

@pietrykovsky
Copy link

actually this issue has been reported earlier - #7657

the workaround for this is to change the node-version to older version. in my case it was to change from node-version: '22.x' to node-version: '22.3.x'

@tanusharma10
Copy link

hey, I am using node:bookworm-slim

@pietrykovsky
Copy link

just use the image with older node version <= 22.4.x

@tanusharma10
Copy link

this will affect build size right?

@pietrykovsky
Copy link

there might be few mb of difference, try node:22.3.0-bookworm-slim

@tanusharma10
Copy link

thanks all that worked.

@mohammedshine17
Copy link

 name: Use Node.js
      uses: actions/setup-node@v4
      with:
        node-version: '22.x'

how to do that ? please help?

@nandeshwarshubh
Copy link

Coming for our organization too on GCP!

@melroy89
Copy link

Duplicate of: #7657?

SteveGoldthorpe added a commit to Hornbill-Docs/hdoc-library that referenced this issue Jul 19, 2024
kiwikern added a commit to digitalservicebund/ris-backend-service that referenced this issue Jul 19, 2024
RISDEV-0000
There's a bug in node 22.5.0's npm that let's npm ci fail.
npm/cli#7666
@joydeep-php-developer
Copy link

I am using node:22-alpine in Dockerfile and facing pm error Exit handler never called. Which version is to use

@akienz
Copy link

akienz commented Jul 19, 2024

I am using node:22-alpine in Dockerfile and facing pm error Exit handler never called. Which version is to use

node:22.4-alpine3.19 seems to work at the moment

@joydeep-php-developer
Copy link

I am using node:22-alpine in Dockerfile and facing pm error Exit handler never called. Which version is to use

node:22.4-alpine3.19 seems to work at the moment

thanks ...its working

@HagegeR
Copy link

HagegeR commented Jul 19, 2024

I restricted the max version in my package.json to fix it:

"engines": {
    "node": ">=22.2.0 <22.5.0"
  },

@DoLoop216
Copy link

Looks like new node image 22.5 have bug in it. Work around would be changing FROM node:22-alpine to FROM node:22.4-alpine in all places in Dockerfile

@milaninfy
Copy link
Contributor

Closing Seems similer if not duplicate of #7657.
Try with node 22.4.1 with npm 10.8.2.

erfanio added a commit to erfanio/up-transaction-tagger that referenced this issue Jul 19, 2024
erfanio added a commit to erfanio/up-transaction-tagger that referenced this issue Jul 19, 2024
erfanio added a commit to erfanio/up-transaction-tagger that referenced this issue Jul 19, 2024
@avijit-shihaan
Copy link

I have changed the node version to 20, issue resolved
FROM node:20-alpine AS builder

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

17 participants