-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[BUG] allow-git=root does not allow root level git dependencies to be installed #9189
Copy link
Copy link
Open
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps
Description
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
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:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps