Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The allow-git=root option refuses to install root-level git dependencies.
Expected Behavior
allow-git=root should install root-level git dependencies but refuse to install transitive git dependencies, per the documentation:
root only allows git dependencies defined in your project's package.json to be fetched installed.
Steps To Reproduce
- Create a simple package.json with a root dependency on a git project
cat > package.json.text <<- EOF
{
"dependencies": {
"left-pad": "github:left-pad/left-pad"
}
}
EOF
- Attempt to install with --allow-git=root
npm install --allow-git=root
- Observe the following error:
$ npm install --allow-git=root
npm error code EALLOWGIT
npm error Fetching non-root packages of type "git" have been disabled
npm error Refusing to fetch "left-pad@github:left-pad/left-pad"
npm error A complete log of this run can be found in:
Environment
- npm: 11.12.1
- Node.js: v25.9.0
- OS Name: Mac OS 15.7.4 (24G517)
- System Model Name:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The allow-git=root option refuses to install root-level git dependencies.
Expected Behavior
allow-git=rootshould install root-level git dependencies but refuse to install transitive git dependencies, per the documentation:Steps To Reproduce
Environment