I read this: How do I override nested NPM dependency versions?
Unfortunately, it does not solve my problem.
I am trying to change a package from using a specific dependency to use another version of that dependency.
Is it built into a package what version of a dependency it should use, or is it possible to change it?
In my case specifically, I am trying to change css-loader
's default dependency on cssnano@3.10.0
(latest) to instead be dependent on cssnano@4.0.0-rc.2
(next).
From the second answer in the above link, user trickpatty notes that:
this will be removed anytime you run npm i instead of editing your package-lock.json and adding the child dependency to "dependencies" there, add the child dependency to your package.json "dependencies" section
Including cssnano@4.0.0-rc.2
in package.json's devDependencies does nothing to css-loader
. It still uses the other (default) version of cssnano
.