出现问题:
import Vuex from ‘vuex’;
Vue.use(Vuex);
安装导入vuex后,在终端执行npm run serve后出现WARNING,网页中vue无法启动
WARNING Compiled with 3 warnings 10:33:05 warning in ../node_modules/vuex/dist/vuex.esm-bundler.js export 'inject' (imported as 'inject') was not found in 'vue' (possible exports: default) warning in ../node_modules/vuex/dist/vuex.esm-bundler.js export 'reactive' (imported as 'reactive') was not found in 'vue' (possible exports: default) warning in ../node_modules/vuex/dist/vuex.esm-bundler.js export 'watch' (imported as 'watch') was not found in 'vue' (possible exports: default)
原因分析:
安装vuex时直接运行 npm install vuex 进行安装,没有指定版本号自动安装了较低的版本号与vue2版本不。
解决方案:
先卸载现有的vuex
npm uninstall vuex
重新安装指定的相关版本
npm install vuex@3
然后重新启动
npm run dev
成功
标签:npm,node,vue,dist,启动,WARNING,vuex From: https://www.cnblogs.com/beyondzw/p/17448190.html