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

pnpm filter always installs the workspace root dependencies #7208

Closed
2 of 4 tasks
pyrocat101 opened this issue Oct 16, 2023 · 1 comment
Closed
2 of 4 tasks

pnpm filter always installs the workspace root dependencies #7208

pyrocat101 opened this issue Oct 16, 2023 · 1 comment

Comments

@pyrocat101
Copy link

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

No response

Which area(s) of pnpm are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

  1. Create a pnpm workspace with package foo.
  2. Add some dependencies to the root package.json and some dependencies to foo/package.json.
  3. pnpm install --filter foo
  4. Notice that dependencies in the root project are also installed.

Describe the Bug

This is a regression since v7.22.0: caused by the partial revert in #5882.

Expected Behavior

Root project dependencies are not installed.

Which Node.js version are you using?

20.8.1

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

@pyrocat101 pyrocat101 changed the title pnpm filter install always install the root workspace dependencies pnpm filter install always install the workspace root dependencies Oct 16, 2023
@pyrocat101 pyrocat101 changed the title pnpm filter install always install the workspace root dependencies pnpm filter always installs the workspace root dependencies Oct 16, 2023
@zkochan
Copy link
Member

zkochan commented Oct 18, 2023

I don't think we can support installation without the root. We can run install in an independent subset of projects but the root node_modules influences all projects in the workspace, and dependencies from the root node_modules are used to resolve peer dependencies in all projects.

If you don't want anything in the root to be installed, then maybe just don't install any dependencies in the root.

I'm personally not sure when would anyone even run a install with --filter. If you want to deploy a single project from the workspace, there's a separate command for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants