Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Workspaces does not honor install strategy shallow #7404

Closed
2 tasks done
sosoba opened this issue Apr 23, 2024 · 1 comment
Closed
2 tasks done

[BUG] Workspaces does not honor install strategy shallow #7404

sosoba opened this issue Apr 23, 2024 · 1 comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x

Comments

@sosoba
Copy link
Contributor

sosoba commented Apr 23, 2024

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 install-strategy=shallow parameter affects only the contents of the "root" node_modules directory.

Expected Behavior

Install strategy sholud work both on root and workspace subprojects.

Steps To Reproduce

package.json

{
  "workspaces": ["web"]
}

web/package.json

{
  "name": "web"
}
npm install --install-strategy=shallow --workspace=web vite
ls web/node_modules/

Sholuld display only single vite directory but there are a lot:
'@esbuild'/ '@rollup'/ '@types'/ esbuild/ nanoid/ picocolors/ postcss/ rollup/ source-map-js/ vite/

Environment

  • npm: 10.5.0
  • Node.js: 20.12.2
  • OS Name: Windows
  • System Model Name: 11
  • npm config:
fetch-retries = 0
update-notifier = false
@sosoba sosoba added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Apr 23, 2024
@wraithgar
Copy link
Member

This is because your workspace does not exist on its own in the tree. To npm there is only one tree, and the workspaces themselves are direct deps of the root. From npm's perspective the install is shallow because in node_modules itself the workspace dependencies are not in the root, but under the workspace itself.

As of now this is working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x
Projects
None yet
Development

No branches or pull requests

2 participants