1

I am using Node 16 and Node 18 for some projects. I have a pipeline where I want to run some tests. My node server is already running in a container with other services for integration tests, and I would like to run jest outside the contaner to test all the API endpoints. Other than jest I need also some other libraries that are listed on the devDependencies.

Since the project is fairly big, I would like to make the pipeline a little bit faster by avoiding installing all the dependencies, and installing only the devDependencies. I see though that all the commands I have found only do not work: --only=dev and --omit=prod do not work for example.

So, what's the right way to install the devDependencies only in 2023?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
gbos
  • 503
  • 2
  • 6
  • 28
  • 1
    You don't. Omit doesn't support "prod": https://docs.npmjs.com/cli/v9/using-npm/config?v=true#omit, and only is gone. – jonrsharpe Aug 09 '23 at 14:15
  • 1
    Does this answer your question? [How to install only "devDependencies" using npm](https://stackoverflow.com/questions/36999461/how-to-install-only-devdependencies-using-npm) – Teneff Aug 09 '23 at 14:15

0 Answers0