4

Let's say I want to install a package in a specific package in my monorepo, how do I do this from root?

in npm, you can do this with something like this:

npm install react --workspace=a

I searched the docs and I can't find a way to do this in pnpm.

Paolo
  • 20,112
  • 21
  • 72
  • 113
Jonathan Lightbringer
  • 435
  • 2
  • 12
  • 27

1 Answers1

4

It is called "filtering" in pnpm docs (see it here).

In this case, you would run:

pnpm --filter=a add react

or

pnpm -F=a add react
Zoltan Kochan
  • 5,180
  • 29
  • 38