Skip to content

Why does “pnpm run” run in current package but “pnpm install” installs all packages? #3615

Answered by zkochan
gaggle asked this question in Q&A
Discussion options

You must be logged in to vote

All the packages in a workspace use a single lockfile and a single virtual store (at <repo root>/node_modules/.pnpm), so it would be hard to install dependencies of a single project in isolation. Also, there might be some shared dev dependencies in the root package.json of the workspace, so it makes little sense to ever not install the dependencies of the root package.json. In a previous version, pnpm install used to install only the dependencies of the project in the active working directory. But it was error prone. Installing everything is pretty fast with hot cache and saves a lot of headache.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@gaggle
Comment options

@zkochan
Comment options

Answer selected by gaggle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants