11

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

Titan
  • 5,567
  • 9
  • 55
  • 90

1 Answers1

1
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
laconbass
  • 17,080
  • 8
  • 46
  • 54
Dantio
  • 1,799
  • 1
  • 10
  • 13