Skip to content

[BUG] npm ci fails on Windows with Node.js 22.0.0 #7417

@westy92

Description

@westy92

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

On Windows, npm ci fails.

(Note: this works fine on Linux and macOS)

https://github.com/westy92/holiday-event-api-js/actions/runs/8827184894/job/24234452752

Run npm ci
  npm ci
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
node:internal/modules/cjs/loader:1[2](https://github.com/westy92/holiday-event-api-js/actions/runs/8827184894/job/24234452752#step:4:2)05
  throw err;
  ^

Error: Cannot find module 'C:\npm\prefix\node_modules\npm\bin\npm-cli.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1202:15)
    at Module._load (node:internal/modules/cjs/loader:1027:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:1[4](https://github.com/westy92/holiday-event-api-js/actions/runs/8827184894/job/24234452752#step:4:5))
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.0.0

Expected Behavior

npm ci succeeds

Steps To Reproduce

  1. on GitHub hosted runners
  2. running windows
  3. running Node 22.0.0
  4. run npm ci

Environment

  • npm: 10
  • Node.js: 22.0.0
  • OS Name: Windows
  • System Model Name: GitHub Windows Runner
  • npm config:
; copy and paste output from `npm config ls` here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions