-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
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
Running npm install --install-strategy=linked repeatedly on a workspace project always reports changed N packages even when nothing has actually changed. The dry-run output shows it "changing" packages to the exact same version (e.g. change abbrev 2.0.0 => 2.0.0), and reports duplicate entries for some packages.
This does not happen for non-workspace projects, which correctly report up to date.
Expected Behavior
Repeated installs with no changes should report up to date, audited N packages as it does for non-workspace projects and for other install strategies.
Steps To Reproduce
- Create a workspace project with cross-workspace dependencies:
mkdir -p test-diamond/packages/{workspace-x,workspace-y}
cat > test-diamond/package.json << 'EOF'
{
"name": "test-diamond",
"version": "1.0.0",
"workspaces": ["packages/*"],
"dependencies": { "workspace-x": "*", "workspace-y": "*" }
}
EOF
cat > test-diamond/packages/workspace-x/package.json << 'EOF'
{
"name": "workspace-x",
"version": "1.0.0",
"dependencies": { "abbrev": "^2.0.0", "workspace-y": "*" }
}
EOF
cat > test-diamond/packages/workspace-y/package.json << 'EOF'
{
"name": "workspace-y",
"version": "1.0.0",
"dependencies": { "abbrev": "^2.0.0" }
}
EOF- Install and then install again:
cd test-diamond
npm install --install-strategy=linked
npm install --install-strategy=linked-
Second install reports
changed 5 packagesinstead ofup to date. -
Dry-run confirms the false diff:
npm install --install-strategy=linked --dry-runOutput:
change abbrev 2.0.0 => 2.0.0
change workspace-y 1.0.0 => 1.0.0
change abbrev 2.0.0 => 2.0.0
change workspace-y 1.0.0 => 1.0.0
change workspace-x 1.0.0 => 1.0.0
changed 5 packages
Environment
- npm: 11.11.0
- Node.js: v22.20.0
- OS Name: macOS (Darwin 25.3.0)
- System Model Name: Mac
- npm config:
install-strategy=linkedReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels