Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a pnpm CLI equivalent to "yarn workspace"?

I’m trying https://pnpm.io/ with workspaces and I can’t seem to be able to install packages and run commands in specific workspaces as I do with Yarn.

Using yarn, I could do, for example:

# adds express to the server workspace
yarn workspace server add express

# run the build script in the common workspace
yarn workspace common run build

How do I achieve the same with the pnpm CLI?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, see https://pnpm.io/filtering

# adds express to the server workspace
pnpm --filter server add express

# run the build script in the common workspace
pnpm --filter common run build

Instead of --filter you may also use -F.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading