`@clerk/upgrade --release=core-3` exits with an npm ERESOLVE error on Next.js 14 instead of saying Next 15 is required

オープン
#10,967 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@wobsoriano がすでに取り組んでいます。

2026年11月24日 から。

  • #10995 @wobsoriano による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
領域
cli, tooling

調査の方向性

Start by reading packages/upgrade/versions/core-3/index.js to see how sdkVersions is declared, then trace performUpgrade() and the main flow in packages/upgrade/cli.js, especially where the package-manager install runs before codemods. Add a pre-install check that reads the installed next version, compares it with the new SDK's peer range, and stops with the suggested message before any install or migration. Verify with a Next 14 fixture that the tool exits early without running npm or codemods, and with Next 15 that the upgrade proceeds.

索引モデルが issue の本文から書いたものです。

説明

Issue

@clerk/nextjs@7 declares the peer dependency next@"^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9 || ^15.6.0-0 || ^16.0.10 || ^16.1.0-0".
@clerk/upgrade never checks the installed next version before upgrading. On a Next 14 app,
npx @clerk/upgrade --sdk=nextjs --release=core-3 runs npm install @clerk/nextjs@7, npm rejects it, and the tool exits with:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error Could not resolve dependency:
npm error peer next@"^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9 || ^15.6.0-0 || ^16.0.10 || ^16.1.0-0" from @clerk/[email protected]
✗ Failed to upgrade @clerk/nextjs
Where

packages/upgrade, as published in @clerk/[email protected]:

  • versions/core-3/index.js: sdkVersions only records the Clerk SDK's own versions (nextjs: { from: 6, to: 7 }).
    There is no minimum framework version.
  • cli.js, performUpgrade(): runs the package manager's install directly. When it fails, it prints the
    package manager's output and calls process.exit(1).
  • cli.js, the main flow: the package upgrade (step 6) runs before the codemods (step 7), so a failed
    install means no codemods run.
Consequences
  • The upgrade stops with nothing migrated: no codemods run and no breaking-change scan is done.
  • The only explanation is npm's peer-dependency dump. Nothing says "upgrade Next.js to 15.2.8+ or 16 first",
    so users have to work it out from npm's resolver output.
Suggested fix

Before step 6, read the installed framework version and compare it with the new SDK's peer range, e.g.
a peerRequirements: { nextjs: { next: '>=15.2.8' } } entry in versions/core-3. If it doesn't match, stop
before changing anything:

core-3 needs Next.js 15.2.8+ or 16. You have 14.2.16. Upgrade Next.js first, then rerun.


Found with modeval, which runs codemods against real repositories
that depend on a package and checks the results.

主要言語
TypeScript
スター
1.8k
フォーク
493
平均マージ
1日 8時間
マージ済み PR(30日)
359

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

clerk/javascript のほかの issue

clerk/javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。