Also, I'm aware that npm has a package npm-force-resolutions, but this feature is not natively supported by npm itself. And yarn turned out pretty cool for me, so I didn't mind the switch.
P.S. - I've even tried generating patches for the deep dependencies' package.json, but it turns out that npm adds a lot of junk that makes the patches unusable, since the changed content differs everytime you re-install dependencies, like after cloning the project. See https://github.com/ds300/patch-package/issues/150 for reference.
(
I've even tried making a custom postinstall script for npm to run, but turns out
that npm only applies the modifications to package-lock.json file only AFTER the whole installation, including the postinstall script, has finished, effectively meaning that's it's either impossible or really hard/complicated/not worth to do.
)
This allows the user to install the preferred chart.js version
For example, I needed some bugfixes from upstream.
The user would obviously need to install
chart.js
himself, so this probably is a breaking change?Edit:
It doesn't seem like this is going to be fixed.
For anyone looking for a work-around - I've started using
yarn
overnpm
, because it can do something like this, calleddependency resolution
:package.json
as you can see - you can modify deep dependencies' versions and such.
Once again - check the documentation.
Also, I'm aware that
npm
has a packagenpm-force-resolutions
, but this feature is not natively supported bynpm
itself. Andyarn
turned out pretty cool for me, so I didn't mind the switch.P.S. - I've even tried generating patches for the deep dependencies'
package.json
, but it turns out thatnpm
adds a lot of junk that makes the patches unusable, since the changed content differs everytime you re-install dependencies, like after cloning the project. See https://github.com/ds300/patch-package/issues/150 for reference.( I've even tried making a custom
postinstall
script for npm to run, but turns out that npm only applies the modifications topackage-lock.json
file only AFTER the whole installation, including thepostinstall
script, has finished, effectively meaning that's it's either impossible or really hard/complicated/not worth to do. )