18

I have vuex@4.0.2 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?

Christopher Shroba
  • 7,006
  • 8
  • 40
  • 68

3 Answers3

23

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 if you are seeing a problem.) If that doesn't work, --force will install without regard to peer dependencies.

Trott
  • 66,479
  • 23
  • 173
  • 212
2

simply try this command

npm install --legacy-peer-deps
Rizwan
  • 3,741
  • 2
  • 25
  • 22
0

If you want peer dependencies to be automatically installed, add "auto-install-peers=true" to an .npmrc file at the root of your project