Is there a way to run npm prune
but a single package that is not in the dependencies?
I know it sounds weird, but there is a legit use-case.
Use case:
- Inside an abstracted CI/CD flow, I want to
npm install
any new additions to thepackage.json
- Then
npm prune
should remove any extraneous packages that may have been removed from thepackage.json
- Then I want to
npm install XXXX
a single dependency that is required only for the CI/CD flow, however subsequent flows should not install this if it is already present, thus on the second execution of the CI/CD flow, thisXXXX
package would be removed via thenpm prune
command. :-(