npm list element-ui;
要先升级element-ui要先卸载原来的版本
npm uninstall element-ui
> uglifyjs-webpack-plugin@0.4.6 postinstall F:\product\test\vue-admin\node_modues\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsvents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64")
added 1201 packages from 674 contributors and audited 11931 packages in 134.032
found 326 vulnerabilities (7 moderate, 319 high)
run `npm audit fix` to fix them, or `npm audit` for details
然后重新进行element-ui的下载
npm install element-ui --save
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsvents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64")
+ element-ui@2.11.1
added 6 packages from 6 contributors and audited 11941 packages in 29.983s
found 326 vulnerabilities (7 moderate, 319 high)
run `npm audit fix` to fix them, or `npm audit` for details
检查一下入口文件main.js内element-ui的css文件,如果是default的修改为/theme-chalk/
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import App from './App'
import router from './router'
升级好了之后运行npm run dev查看是否更新成功