I have [email protected] installed. I want to install vuex-module-decorators@latest, which has a peerDependency of vuex 3 (not >=3). I have a feeling this will work fine with vuex 4. Is there a way for me to tell npm to install this new package, without crashing due to not being able to resolve the peer dependency (since 4 != 3)? Or do I need to just create my own fork of vuex-module-decorators with an updated package.json that allows vuex >=3?
Fast but potentially unsafe: Using --legacy-peer-deps will usually allow you to install the package without meeting the peer dependency requirements. (This was the default using npm@6 so I assume you are using npm@7 or later if you are seeing a problem.) If that doesn't work, --force will install without regard to peer dependencies.
Requires slightly more effort but is more safe/surgical: Use npm overrides. These were introduced in npm 8.x.
You should use overrides with modern versions of npm, since --legacy-peer-deps is less safe and could silence other legacy peer dependencies that you may want to fix:
"overrides": {
"vuex-module-decorators": {
"vuex": "$vuex",
}
}
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