Skip to content

ci: run npm ci with the npm from packageManager - #11

Open
mklocek wants to merge 1 commit into
mainfrom
ci/npm-from-package-manager
Open

mklocek wants to merge 1 commit into
mainfrom
ci/npm-from-package-manager

Conversation

@mklocek

@mklocek mklocek commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Motivation

Dependabot regenerates package-lock.json with the npm pinned in packageManager (npm@11.19.1), but CI ran npm ci with the npm 10 that ships with Node 22. npm 10 rejects some npm 11 lockfiles: #10 failed with Missing: @medusajs/ui@4.2.8 from lock file because npm 11 dropped an optional peer entry. Every Dependabot lockfile PR can break the same way.

Changes

  • Compatibility, locked row: install the npm from packageManager before npm ci.
  • Release build job: the same step before npm ci / npm pack.
  • The lowest and latest rows keep Node 22's npm. They install with --no-package-lock, so they never read the lockfile, and with npm 11 the lowest tree breaks: ajv-draft-04 is hoisted away from its ajv@8 peer and the tests fail with Cannot find module 'ajv/dist/core'.
  • The version is read from package.json, so a packageManager bump carries over to CI.

How to test

  • With npm 11.19.1 on Node 22: npm ci accepts main's lockfile without changing it; npm test, tsc --noEmit, medusa plugin:build, npm pack and the packed-plugin install in a new project pass
  • Release build commands (npm ci, npm test, npm run prepublishOnly, npm pack) pass with npm 11.19.1
  • Compatibility workflow passes on this PR

Dependabot regenerates package-lock.json with the npm pinned in
packageManager (npm 11), while CI ran npm ci with the npm 10 bundled with
Node 22. npm 10 rejects some npm 11 lockfiles (a dropped optional peer
entry made it fail with "Missing: ... from lock file").

Install that npm before npm ci in the Compatibility locked row and the
Release build job. The lowest and latest rows install with
--no-package-lock and keep npm 10: npm 11 hoists ajv-draft-04 away from
its ajv@8 peer there and the tests fail to load.
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e5cc1401-c764-403d-99ad-9a25dde45390
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@mklocek
mklocek requested review from Rabsztok and izikaj November 26, 2026 10:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants