Corepack incorrectly selects prerelease/dev versions of pnpm when no version is specified
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- nodejs, typescript
調査の方向性
まず corepack use pnpm の解決パスと、pnpm の package.json の読み取り方法を追跡します。ここで説明されている Node.js 20、Corepack 0.34.4、Alpine の環境で動作を再現してください。未指定の pnpm リクエストが最新の安定版リリースを選択し、ハードコードされたレガシーパスではなく、その現在のバイナリエントリパスを使用すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
After some discussion on the pnpm issue (https://github.com/pnpm/pnpm/issues/10214), it turns out the problem is not caused by a faulty pnpm release, pnpm v11 has changed its binary entry path from bin/pnpm.cjs to bin/pnpm.mjs., so the development build 11.0.0-dev.1005 is not faulty. Corepack is expecting the old path and fails.
So the issue appears to be:
- Corepack’s version resolution prefers a dev build over the latest stable
- Corepack seems to rely on a hardcoded pnpm binary path instead of reading the correct bin path from package.json.
As a workaround I'm currently using
corepack use pnpm@10.22.0orcorepack use pnpm@latest(or latest-9, latest-10 etc.)Leaving this update here so the root cause is clearer.
Originally posted by @tkesici in #772
Problem
When running corepack use pnpm, Corepack unexpectedly selects and installs a prerelease development build of pnpm (11.0.0-dev.1005) instead of the latest stable version .
This leads to failure because pnpm v11 is not stable yet and its structure differs from the current pnpm 10.x series.
Expected Behavior
If no version is specified, Corepack should prefer the latest stable release of pnpm (e.g 10.x)
Actual Behavior
corepack use pnpm resolves to: Installing pnpm@11.0.0-dev.1005...
Environment
Node.js: 20 (node:20-alpine)
Corepack: 0.34.4
OS: Alpine Linux
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 279
- 平均マージ
- 1時間 47分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/corepack のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
nodejs/corepack の issue をすべて見る
似ている issue
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
Mend: dependency security vulnerability untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100