Skip to content

fix(deps): package-lock.json を再生成して CI の npm ci 失敗を解消 - #339

Merged
nus3 merged 1 commit into
masterfrom
fix/ci-build-lockfile
Nov 5, 2026
Merged

nus3 merged 1 commit into
masterfrom
fix/ci-build-lockfile

Conversation

@nus3

@nus3 nus3 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

概要

master の CI(gh-pages.yml の build ジョブ)が npm ci --ignore-scripts で失敗しているのを修正します。
失敗した run: https://github.com/cybozu/frontend-monthly/actions/runs/41805427621/job/126491130430

npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync.
npm error Missing: @astrojs/compiler-rs@0.4.1 from lock file
npm error Missing: @astrojs/compiler-binding@0.4.1 from lock file
...

原因

#338 で astro を 7.3.1 → 7.4.1 に更新した際、@astrojs/compiler-rs の依存解決が不完全なまま lockfile が更新されていました。

  • astro 7.4.1 は @astrojs/compiler-rs ^0.5.1 を要求し、lockfile のトップレベルは 0.5.2 に更新済み
  • prettier-plugin-astro 1.1.1 は @astrojs/compiler-rs ^0.4.0 を要求する(更新前はトップレベルが 0.4.0 で両方を満たしていた)
  • 本来 node_modules/prettier-plugin-astro/node_modules/@astrojs/compiler-rs にネストされるべき 0.4.x のエントリが lockfile に無く、npm ci が不整合として検出していた

変更内容

npm install で lockfile を再生成しました(手編集なし)。差分は package-lock.json のみです。

  • 追加: node_modules/prettier-plugin-astro/node_modules/@astrojs/compiler-rs@0.4.1 と @astrojs/compiler-binding-*@0.4.1 群
  • 削除: @astrojs/compiler@2.13.1(どのパッケージからも依存されていない孤立エントリ)
  • resolved はすべて npm.flatt.tech のまま

見送ったこと

prettier-plugin-astro 1.1.2 は @astrojs/compiler-rs ^0.5.2 に対応しており、更新すれば compiler-rs を 1 バージョンに統一できます。ただし公開が 2026-10-23 で、.npmrc の min-release-age=14 にかかるため今回は見送りました。2026-11-06 以降に別 PR で更新するのがよさそうです。

確認したこと

  • npm ci --ignore-scripts --dry-run(CI と同じ)が同期エラーなしで成功
  • npm run build(astro check && tsc --noEmit && astro build):74 ページ
  • この PR の Check build

astro 7.4.1 への更新 (#338) 以降、prettier-plugin-astro 1.1.1 が要求する
@astrojs/compiler-rs ^0.4.0 のネストエントリが lockfile に無く、
CI の npm ci が package.json との不整合で失敗していた。
npm install で lockfile を再生成し、prettier-plugin-astro 配下に
@astrojs/compiler-rs 0.4.1 と compiler-binding 群を追加する。
あわせて、どのパッケージも依存していない @astrojs/compiler 2.13.1 の
孤立エントリが削除される。
@nus3
nus3 merged commit 5de9284 into master Nov 5, 2026
1 check passed
@nus3
nus3 deleted the fix/ci-build-lockfile branch November 5, 2026 00:28
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.

1 participant