[BUG] allow-git=root rejects a root git dependency with EALLOWGIT after its tag or branch changes in package.json
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- git, javascript, nodejs
調査の方向性
Start by reproducing with the steps in the issue: set allow-git=root, install a root git dependency, change its tag, and install again to see EALLOWGIT. Search the codebase for the EALLOWGIT error and the allow-git root check, then find where a changed git ref interacts with the lockfile. Done means the second install succeeds with allow-git=root and a regression test covers changing a root git ref.
索引モデルが issue の本文から書いたものです。
説明
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
This is not just a request to bump a dependency for a CVE
- This is not solely a request to bump a dependency for a CVE
Current Behavior
With allow-git=root, changing the tag or branch of a git dependency
that is declared in the root package.json makes npm install fail:
npm error code EALLOWGIT
npm error Fetching non-root packages of type "git" have been disabled
npm error Refusing to fetch "ini@git+ssh://[email protected]/npm/ini.git#180a8d5c72d7f13ed70c53619132f3a8ee5ac6ed"
The package is a direct dependency of the project root. A fresh install
of the same package.json without a lockfile works.
Expected Behavior
npm install re-resolves the changed ref and installs the package,
since it is a root dependency and allow-git=root allows those.
Steps To Reproduce
mkdir repro && cd repro
echo 'allow-git=root' > .npmrc
echo '{"name":"repro","dependencies":{"ini":"github:npm/ini#v5.0.0"}}' > package.json
npm install # works
echo '{"name":"repro","dependencies":{"ini":"github:npm/ini#v6.0.0"}}' > package.json
npm install # fails with EALLOWGIT
Workaround: run npm install --allow-git=all once. It updates the
lockfile, after which npm ci and npm install work again with
allow-git=root.
Environment
- npm: 12.2.3 (also 11.21.3 and 11.20.0)
- Node.js: v26.13.1
- OS Name: Ubuntu 26.04.1 LTS
- System Model Name: n/a
- npm config:
allow-git = "root"
- 主要言語
- JavaScript
- スター
- 10.3k
- フォーク
- 5k
- 平均マージ
- 4日 11時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
npm/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 2 日以内に返信
-
[BUG] scripts/dependency-graph.js splits npm-cli-repos.txt on os.EOL, so DEPENDENCIES.md depends on the checkout's line endings対応中かも @saruk-vedant が 7 日前に担当しました。 オープンBug Needs Triage Triage Requested
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
[BUG] npm pkg delete removes the first array item for a nonexistent property対応中かも @drawliin が 42 日前に担当しました。 オープンcmd:delete Priority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 2 日以内に返信
-
create node pr: Node.js 20 deprecation & `DEP0040` warnings logged再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンEngineering Priority 1
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
`npm audit signatures` does not report how many packages it skipped for want of registry keys対応中かも @greenlincoln05 が 63 日前に担当しました。 オープンPriority 3
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
docs: add SECURITY.md vulnerability reporting policy対応中かも @AK-Lmn が今日担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
flisk-sh/linux2wasm#12 ·
メンテナーはふだん 1 日以内に返信
-
possible bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Mintplex-Labs/anything-llm#7388 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 60/100
メンテナーはふだん 1 日以内に返信
-
v6: Minified bootstrap.min.css is missing header info対応中かも @lazerg が今日担当しました。 オープンbug build confirmed has-pr v6
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
githubnext/gh-aw-workshop#6332 ·
メンテナーはふだん 1 日以内に返信