Before we can create a Vuex store, we must install Vuex and import it using the following steps:
- Install Vuex by using npm:
$ npm i vuex
- Import and register it by using the Vue.use() method:
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
Remember that the preceding installation steps are meant to use Vuex with a module system, which is what we are going for in this chapter. But before jumping into a module system app, we should take a look at how we can create the Vuex app by using CDN or a direct download in the next section.
Note that Vuex requires Promise support. If your browser does not support Promise, please check out how you can install a polyfill library for your apps at https://vuex.vuejs.org/installation.html#promise.