NPM Workspaces only install root packages
Asked Answered
R

1

12

During my CI deployments I want to only install package relavent depancies required for that run.

I can do this with npm install --workspace package-name

However I have some root level scripts with only a handful of deps in the root package.json, how do I install just those?

npm install without a workspace flag will install everything.

I'm looking for something like:

npm install --workspace none

Rack answered 14/7, 2022 at 10:55 Comment(0)
V
5
npm i --workspaces=false

That should only install the root dependencies.

It's also possible with npm ci

npm ci --workspaces=false

And using the short flag -ws

npm ci -ws=false
Volumeter answered 11/11, 2022 at 9:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.