[Vuejs]-Why is there an error when installing vuex?

9👍

That is because you’re trying to install Vuex@4, which is only compatible with Vue@3. However, your project is using Vue@2 instead.

You will need to decide which Vue version you want to use. Since you mentioned that you only want to use Vue2, you need to install the Vuex@3 instead:

npm install vuex@3
👤Terry

Leave a comment