According to the official NPM docs, overrides in package.json allows for overriding a package with another package entirely:
Overrides provide a way to replace a package in your dependency tree with another version, or another package entirely. These changes can be scoped as specific or as vague as desired.
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides
However, I can't figure out how to replace a package with anything other than a changed version of the same package.
I'm trying to replace node-sass with sass in a transitive dependency but no configuration that I've tried works.
"overrides": {
"node-sass": "sass@^1.3.0"
}
"overrides": {
"node-sass": {
".": "sass@^1.3.0"
}
}
Either of the above configuration produces the following NPM error:
Invalid tag name "sass@^1.3.0": Tags may not have any characters that encodeURIComponent encodes.
If I try something more rudimentary:
"overrides": {
"node-sass": "sass"
}
NPM errors with:
No matching version found for node-sass@sass.
I'm on NPM v8.3.1.
Is it actually possible to replace a package with another package entirely or am I misunderstanding what's written in the docs?