更新package.json中的dependencies依赖到最新版本 -

我们从别人那里下载一个项目 ,通过package.json里面的依赖 npm  install 来安装所需要的各个包

但是 有可能项目很老,我们一个个更新又很麻烦所以

https://blog.csdn.net/zhangteng22/article/details/76438776

 

 

hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ sudonpm install -g npm-check-updates
sudonpm:未找到命令
hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ sudo npm install -g npm-check-updates
/usr/bin/npm-check-updates -> /usr/lib/node_modules/npm-check-updates/bin/npm-check-updates
/usr/bin/ncu -> /usr/lib/node_modules/npm-check-updates/bin/ncu
+ npm-check-updates@2.14.2
added 383 packages from 588 contributors in 11.187s
hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ ncuUsing /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json
[..................] / :
 @angular/common                           ^2.3.1  →   ^6.1.2 
 @angular/compiler                         ^2.3.1  →   ^6.1.2 
 @angular/core                             ^2.3.1  →   ^6.1.2 
 @angular/forms                            ^2.3.1  →   ^6.1.2 
 @angular/http                             ^2.3.1  →   ^6.1.2 
 @angular/platform-browser                 ^2.3.1  →   ^6.1.2 
 @angular/platform-browser-dynamic         ^2.3.1  →   ^6.1.2 
 @angular/router                           ^3.3.1  →   ^6.1.2 
 angular2-jwt                             ^0.1.28  →   ^0.2.3 
 bootstrap                                 ^3.3.7  →   ^4.1.3 
 rxjs                                      ^5.0.1  →   ^6.2.2 
 zone.js                                   ^0.7.2  →  ^0.8.26 
 @angular/cli                          1.0.0-rc.16.1.3 
 @angular/compiler-cli                     ^2.3.1  →   ^6.1.2 
 @types/jasmine                            2.5.382.8.8 
 @types/node                              ^6.0.42  →  ^10.5.8 
 codelyzer                          ~2.0.0-beta.1  →   ~4.4.3 
 jasmine-core                               2.5.23.2.0 
 jasmine-spec-reporter                      2.5.04.2.1 
 karma                                      1.2.03.0.0 
 karma-remap-istanbul                      ^0.2.1  →   ^0.6.0 
 protractor                               ~4.0.13  →   ~5.4.0 
 ts-node                                    1.2.17.0.1 
 tslint                                    ^4.3.0  →  ^5.11.0 
 typescript                                ~2.0.3  →   ~3.0.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.

 ace-builds             ^1.2.6  →  ^1.4.1 
 core-js                ^2.4.1  →  ^2.5.7 
 jquery                 ^3.1.1  →  ^3.3.1 
 karma-chrome-launcher  ^2.0.0  →  ^2.2.0 
 karma-jasmine          ^1.0.2  →  ^1.1.2 

Run ncu with -u to upgrade package.json

hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ ncu -u
Using /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json
[..................] / :
 @angular/common                           ^2.3.1  →   ^6.1.2 
 @angular/compiler                         ^2.3.1  →   ^6.1.2 
 @angular/core                             ^2.3.1  →   ^6.1.2 
 @angular/forms                            ^2.3.1  →   ^6.1.2 
 @angular/http                             ^2.3.1  →   ^6.1.2 
 @angular/platform-browser                 ^2.3.1  →   ^6.1.2 
 @angular/platform-browser-dynamic         ^2.3.1  →   ^6.1.2 
 @angular/router                           ^3.3.1  →   ^6.1.2 
 angular2-jwt                             ^0.1.28  →   ^0.2.3 
 bootstrap                                 ^3.3.7  →   ^4.1.3 
 rxjs                                      ^5.0.1  →   ^6.2.2 
 zone.js                                   ^0.7.2  →  ^0.8.26 
 @angular/cli                          1.0.0-rc.16.1.3 
 @angular/compiler-cli                     ^2.3.1  →   ^6.1.2 
 @types/jasmine                            2.5.382.8.8 
 @types/node                              ^6.0.42  →  ^10.5.8 
 codelyzer                          ~2.0.0-beta.1  →   ~4.4.3 
 jasmine-core                               2.5.23.2.0 
 jasmine-spec-reporter                      2.5.04.2.1 
 karma                                      1.2.03.0.0 
 karma-remap-istanbul                      ^0.2.1  →   ^0.6.0 
 protractor                               ~4.0.13  →   ~5.4.0 
 ts-node                                    1.2.17.0.1 
 tslint                                    ^4.3.0  →  ^5.11.0 
 typescript                                ~2.0.3  →   ~3.0.1 
 ace-builds             ^1.2.6  →  ^1.4.1 
 core-js                ^2.4.1  →  ^2.5.7 
 jquery                 ^3.1.1  →  ^3.3.1 
 karma-chrome-launcher  ^2.0.0  →  ^2.2.0 
 karma-jasmine          ^1.0.2  →  ^1.1.2 
Upgraded /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json

hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ ncu -a
Using /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json
[..................] \ :
 ace-builds             ^1.2.6  →  ^1.4.1 
 core-js                ^2.4.1  →  ^2.5.7 
 jquery                 ^3.1.1  →  ^3.3.1 
 karma-chrome-launcher  ^2.0.0  →  ^2.2.0 
 karma-jasmine          ^1.0.2  →  ^1.1.2 
Upgraded /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json

hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ 
View Code

 然后 sudo npm install 

来安装

 

转载于:https://www.cnblogs.com/PoeticalJustice/p/9464959.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值