how to avoid re-compiling an npm package?

55 Views Asked by At
  • in my pipelines, i regularly have to call npm ci
  • some npm packages require compilation (e.g. pg-native, node-rdkafka)
  • compilation is slow

how can I make the second call to npm ci avoid compiling again?

  • i have tried calling npm install -g pg-native first, but npm ci still recompiles
  • in the past i used peerDepdendencies as a workaround, but that no longer appears to work (from npm version 7, i believe)

is it possible for an app to use a compiled cached dependency?

0

There are 0 best solutions below