0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Cloudflare Pages + pnpm で Internal Error: Cannot find matching keyid に遭遇したときの解決法

Posted at

エラーの内容

pnpm プロジェクトを Cloudflare Pages にデプロイしようとしたらエラーに遭遇した。

Screenshot 2025-02-26 at 22.28.53.png

Preparing pnpm@10.5.0 for immediate activation…
Internal Error: Cannot find matching keyid: {"signatures":
...

wrangler.toml で node.js v22 以上、pnpm v10 以上を指定していた:

NODE_VERSION = ">=22"
PNPM_VERSION = ">=10"

デプロイ時に指定されたバージョンはこれ。

Detected the following tools from environment: nodejs@22.8.0, pnpm@10.5.0

回避策

調べてみると、原因は corepack が新しいバージョンのパッケージマネージャーの署名キーIDを検証できず、エラーになっているということだった。

回避方法として corepack v0.31.0 を使う方法があり、それには nodejs v23.7.0 以上を使う必要がある。

そこで wrangler.toml を NODE_VERSION = ">=23" のように変更し、再度デプロイしたところ、nodejs v23.8.0 がインストールされた:

Detected the following tools from environment: nodejs@23.8.0, pnpm@10.5.0

そして無事デプロイが通った。

まとめ

この問題は Cloudflare Pages へのデプロイ時に遭遇したものだが、corepack と pnpm を使っている環境なら、他の状況でも遭遇する可能性がある。

同様のエラーに遭遇した方の参考になれば幸いだ。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?