Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM Workspaces only install root packages

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

like image 365
Titan Avatar asked Feb 28 '26 10:02

Titan


1 Answers

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
like image 57
Dantio Avatar answered Mar 02 '26 15:03

Dantio



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!