|
使用npm管理node的包,可以使用npm update <name>对单个包升级,对于npm的版本大于 2.6.1,可以使用命令:
npm install -g
升级全局的本地包。
比如我的element-ui模块,当前是版本是1.3.7,而最新的版本,是1.4.1。
但是执行
npm update
更新命令,只能按照package.js中标注的版本号,进行更新,所以每次都要改下package.js中的版本号为最新才能够更新,太麻烦,没什么用处。那还有没有更好的办法呢,当然有,就是高效升级插件npm-check-updates
安装方法
查看最新的版本
[..................] \ :
@angular-devkit/build-angular ~0.6.8 → ~0.8.4
@types/node ~8.9.4 → ~10.11.5
codelyzer ~4.2.1 → ~4.5.0
jasmine-core ~2.99.1 → ~3.2.1
karma ~1.7.1 → ~3.0.0
karma-jasmine-html-reporter ^0.2.2 → ^1.3.1
ts-node ~5.0.1 → ~7.0.1
tslint ~5.9.1 → ~5.11.0
typescript ~2.7.2 → ~3.1.1
The following dependencies are satisfied by their declared version range, but the installed versions are behind. You can install the latest versions without modifying your package file by using npm update. If you want to update the dependencies in your package file anyway, run ncu -a.
@angular/animations ^6.0.3 → ^6.1.9
@angular/common ^6.0.3 → ^6.1.9
@angular/compiler ^6.0.3 → ^6.1.9
@angular/core ^6.0.3 → ^6.1.9
@angular/forms ^6.0.3 → ^6.1.9
@angular/http ^6.0.3 → ^6.1.9
@angular/platform-browser ^6.1.4 → ^6.1.9
@angular/platform-browser-dynamic ^6.0.3 → ^6.1.9
@angular/router ^6.0.3 → ^6.1.9
bootstrap ^4.1.1 → ^4.1.3
popper.js ^1.14.3 → ^1.14.4
rxjs ^6.0.0 → ^6.3.3
@angular/cli ^6.1.5 → ^6.2.4
@angular/compiler-cli ^6.0.3 → ^6.1.9
@angular/language-service ^6.0.3 → ^6.1.9
@types/jasmine ~2.8.6 → ~2.8.9
@types/jasminewd2 ~2.0.3 → ~2.0.5
karma-coverage-istanbul-reporter ~2.0.0 → ~2.0.4
protractor ^5.4.0 → ^5.4.1
Run ncu with -u to upgrade package.json 升级
这说明有些包需要升级 这时候我们使用
就可以全部升级了。
当然,如果所有包都是最新版本,执行ncu后会提示:
All dependencies match the latest package versions :)
|
上一篇:不再纠结devDependencies与dependencies下一篇:vs code 快速新建一个html文件
|