npm の段階的公開機能とインストール時の制御オプションが利用可能に
本文の状態
日本語全文を表示中
詳細モードで約4分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
GitHub Changelog
npm はバージョン 11.15.0 で、サプライチェーンセキュリティを強化する新機能をリリースした。具体的には、パッケージの公開を段階的に実施できる「段階的公開」機能が一般提供され、ファイルやリモートソースからのインストールを制御する新しいフラグが追加された。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
本日、npm のサプライチェーンセキュリティに焦点を当てた 2 つの更新を発表します。
ステージング公開(Staged publishing)が一般利用可能になりました。
新しいインストールソースフラグ(--allow-file, --allow-remote, --allow-directory)が、既存の --allow-git フラグを補完します。
これらは npm CLI 11.15.0 以降で利用可能です。
ステージング公開が一般利用可能になりました
npm におけるステージング公開が、本日一般利用可能となりました。パッケージバージョンを直接公開して即座に消費者に利用可能にするのではなく、事前にビルドされた tarball をステージキューにアップロードし、インストール可能になる前にメンテナが明示的に承認する必要があります。このキューは npmjs.com と npm CLI の両方で確認できます。
ステージング公開は、すべての公開(非対話型 CI/CD ワークフローから発生するものや、OIDC を使用した信頼できる公開を利用するものを含む)において「存在証明」を強化します。パッケージがレジストリにリリースされる前に、2FA 認証の課題に答える人間によるメンテナの承認が必要です。
ステージング公開は本日稼働を開始し、ドキュメントも同時に公開されています。
概要と入門ガイド
CLI リファレンスと権限
信頼できるパブリッシャー(更新版)
要件
npm stage を使用するには、npm CLI 11.15.0 以降が必要です。
ステージング動作を望む箇所では、npm publish の代わりに npm stage publish を使用するよう CI/CD ワークフローを更新してください。
推奨セットアップ
段階的公開は、信頼できる公開(OIDC)と組み合わせて行うことを推奨します。信頼できる公開の設定をステージング専用に制限することで、そのワークフローからの npm publish は拒否され、npm stage publish のみが受け入れられるようになります。CI ワークフローは非対話式で継続して実行され、後からメンテナーがウェブサイトまたは CLI からステージングされたバージョンを承認します。
ローカルでも npm stage publish を実行できますが、最も価値が高いセットアップは、CI でステージングキューへ公開し、信頼できるデバイスからメンテナーが承認する構成です。
2026 年 2 月にリリースされた一括の信頼できる公開設定を既に管理している場合は、それを使用してパッケージを段階的公開へ移行できます。CI ワークフローを新しい CLI バージョンに更新し、npm stage publish を使用することを忘れないでください。
新規インストールソースフラグ
npm 11.10.0 では、npm install が Git ソースから依存関係を解決できるかどうかを制御するために --allow-git を導入しました。npm 11.15.0 から、レジストリ以外のすべてのインストールソースに対して同じ明示的な許可リストアプローチを適用できるよう、さらに 3 つのフラグを追加します:
--allow-file: ローカルファイルパスおよびローカル tarball からのインストールを制御します。
--allow-remote: リモート URL(https tarball を含む)からのインストールを制御します。
--allow-directory: ローカルディレクトリからのインストールを制御します。
--allow-git (既存): github:, gitlab:, git+ URL、および簡略化された所有者/リポジトリ表記を含む、あらゆる Git ソースからのインストールを制御します。
各フラグは、すべて(現在のデフォルト)または none のいずれかを受け付け、.npmrc または package.json 設定でも設定可能です。
詳細については、以下のドキュメントをご覧ください:
npm install リファレンス (--allow-file, --allow-remote, --allow-git バリアントは同じページに記載されています)
設定リファレンス
2026 年 2 月の発表の復習として、--allow-git は CLI の次期メジャーバージョン (v12) でデフォルトが「すべて」から「none」に変更されます。新しい --allow-file, --allow-remote, および --allow-directory フラグは 11.15.0 で追加された機能です。より厳格な動作を今日から適用したい場合は、これらを none に設定してください。
議論に参加する
これらの変更の展開状況について、ぜひお聞かせください。フィードバックや質問は GitHub コミュニティのディスカッションで共有してください。
本記事「npm の段階的公開とインストール時の新しい制御機能」は、最初に The GitHub Blog で掲載されました。
原文を表示
Today we’re shipping two updates focused on supply-chain security for npm:
Staged publishing is generally available.
New --allow-* install source flags (--allow-file, --allow-remote, --allow-directory) complement the existing --allow-git flag.
Both are available in npm CLI 11.15.0 or newer.
Staged publishing is generally available
Staged publishing is now generally available on npm. Instead of a direct publish that immediately makes a package version available to consumers, the prebuilt tarball is uploaded to a stage queue where a maintainer must explicitly approve it before it becomes installable. The queue is visible both on npmjs.com and in the npm CLI.
Staged publishing reinforces proof of presence on every publish, including those that originate from non-interactive CI/CD workflows and those using trusted publishing with OIDC. A human maintainer with a 2FA challenge is required to approve a staged package before it is released to the registry.
Staged publishing is live today, and so are the docs.
Overview and getting started
CLI reference and permissions
Trusted publishers (updated)
Requirements
npm CLI 11.15.0 or newer is required to use npm stage.
Update CI/CD workflows to use npm stage publish instead of npm publish where you want staged behavior.
Recommended setup
We recommend pairing staged publishing with trusted publishing (OIDC). A trusted publishing configuration can be limited to stage-only, which means npm publish from that workflow will be rejected and only npm stage publish is accepted. Your CI workflows continue to run non-interactively, and a maintainer later approves the staged version from the website or the CLI.
You can also run npm stage publish locally, but the highest-value setup is CI publishing to the stage queue and a maintainer approving from a trusted device.
If you already manage trusted publishing configurations in bulk, released Feb 2026, you can use it to migrate your packages to staged publishing. Remember to update your CI workflows to the new CLI version and to use npm stage publish.
New install source flags
In npm 11.10.0 we introduced --allow-git to give you control over whether npm install can resolve dependencies from Git sources. Starting in npm 11.15.0, we are adding three more flags so you can apply the same explicit-allowlist approach to every nonregistry install source:
--allow-file: Controls installs from local file paths and local tarballs.
--allow-remote: Controls installs from remote URLs, including https tarballs.
--allow-directory: Controls installs from local directories.
--allow-git (existing): Controls installs from any Git source, including github:, gitlab:, git+ URLs, and bare owner/repo shorthands.
Each flag accepts all (the current default) or none, and can also be set in .npmrc or package.json config.
Learn more by checking out our docs:
npm install reference (the --allow-file, --allow-remote, --allow-git variants are on the same page)
Config reference
As a reminder from the Feb 2026 announcement, --allow-git will change its default from all to none in the next major version of the CLI (v12). The new --allow-file, --allow-remote, and --allow-directory flags are additions in 11.15.0—you can opt into stricter behavior today by setting them to none.
Join the discussion
We’d like to hear how you’re rolling this out. Share feedback and questions in the GitHub Community discussion.
The post Staged publishing and new install-time controls for npm appeared first on The GitHub Blog.
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み