Open ErikBrendel opened 12 months ago
Fixed in v16.14.2
. Thanks!
FYI: In researching the problem, I came across this recommendation in the official npm docs (emphasis mine):
You may not set an override for a package that you directly depend on unless both the dependency and the override itself share the exact same spec. To make this limitation easier to deal with, overrides may also be defined as a reference to a spec for a direct dependency by prefixing the name of the package you wish the version to match with a $.
{
"name": "example",
"dependencies": {
"typescript": "^5.1.6"
},
"overrides": {
"typescript": "$typescript"
}
}
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
Unfortunately, the recommendation from the official npm docs does not always work https://github.com/npm/cli/issues/5730
This comment explains in more detail what is happening https://github.com/npm/cli/issues/5730#issuecomment-1627722630
npm-check-updates
node >= 14.14
Steps to Reproduce
npx -y npm-check-updates --interactive
and press enter twice (updating this dependency and installing the changes)Current behavior
Only the dep is updated, and not the override, leading to this error output:
Desired behavior
In these cases where the dependency and the override are equal, the dependency and override should be updated in sync, so that the installation then works.