We are using npm-check-updates
to update our package.json
dependency.
We have serious issues with it because we have many small projects that need to have a fixed version for a certain dependency.
I am a module writer and we do not want to fix version for our users in our package.json
, but we want to support up to a version voluntary on our side.
Most of the time, when we build something on top of, we want to stick to show the dependency set by the core one.
We found ncu -ua
to be an excellent command when we do not have a fixed version in our package, but we must proceed to a manual edition of package.json
when we do have fixed version.
Is there a way using a file or whatever, to set a list of ignored dependency when using ncu -ua
?
That would save us a lot of time.
npm-check-updates
has a flag -x, --reject
to ignore certain packages when checking for updates.
ncu -u -x mobx,query-string
Will update all outdated dependencies except mobx and query-string (dropped IE11 support at certain versions).
To have a place where to write down the dependencies that shouldn't be updated anymore, the above command can be added to the scripts inside package.json
like this:
{
"name": "my-project",
"scripts": {
"update": "ncu -u -x mobx,query-string"
}
}
Always remember to update through npm run update
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With