安装npm-check-updates组件
npm install -g npm-check-updates
ncu -u
实际运行
npm install -g npm-check-updates
added 263 packages, and audited 264 packages in 20s
29 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
D:\IdeaProjects\springboot_activiti_leave_process_web4\vue-activiti-frontend>ncu -u
Upgrading D:\IdeaProjects\springboot_activiti_leave_process_web4\vue-activiti-frontend————\package.json
[====================] 12/12 100%
axios ^0.21.4 → ^0.26.1
core-js ^3.6.5 → ^3.21.1
element-plus ^1.1.0-beta.9 → ^2.1.8
vue ^3.0.0 → ^3.2.31
vue-router ^4.0.0-0 → ^4.0.14
vuex ^4.0.0-0 → ^4.0.2
@vue/cli-plugin-babel ~4.5.0 → ~5.0.4
@vue/cli-plugin-router ~4.5.0 → ~5.0.4
@vue/cli-plugin-vuex ~4.5.0 → ~5.0.4
@vue/compiler-sfc ^3.0.0 → ^3.2.31
Run npm install to install new versions.
升级vue
一般就是升级 vue 和 vue-template-compiler,两者的版本需要同步。
npm update vue -S
或者 yarn add vue -S
npm update vue-template-compiler -D 或者 yarn add vue-template-compiler -D
npm升级到最新版本
#查看npm当前版本
npm -v
#如果不是最新版本,运行指令
npm install -g npm
#如果想更新到指定版本,运行指令
npm -g install npm@6.8.0