PoeticalJustice

导航

更新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 

来安装

 

posted on 2018-08-12 21:20  PoeticalJustice  阅读(1690)  评论(0编辑  收藏  举报