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

时间:2024-04-15 02:10:42

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

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

https://blog.****.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.
added packages from contributors in .187s
hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$ ncuUsing /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json
[..................] / :
@angular/common ^2.3. → ^6.1.
@angular/compiler ^2.3. → ^6.1.
@angular/core ^2.3. → ^6.1.
@angular/forms ^2.3. → ^6.1.
@angular/http ^2.3. → ^6.1.
@angular/platform-browser ^2.3. → ^6.1.
@angular/platform-browser-dynamic ^2.3. → ^6.1.
@angular/router ^3.3. → ^6.1.
angular2-jwt ^0.1. → ^0.2.
bootstrap ^3.3. → ^4.1.
rxjs ^5.0. → ^6.2.
zone.js ^0.7. → ^0.8.
@angular/cli 1.0.-rc. → 6.1.
@angular/compiler-cli ^2.3. → ^6.1.
@types/jasmine 2.5. → 2.8.
@types/node ^6.0. → ^10.5.
codelyzer ~2.0.-beta. → ~4.4.
jasmine-core 2.5. → 3.2.
jasmine-spec-reporter 2.5. → 4.2.
karma 1.2. → 3.0.
karma-remap-istanbul ^0.2. → ^0.6.
protractor ~4.0. → ~5.4.
ts-node 1.2. → 7.0.
tslint ^4.3. → ^5.11.
typescript ~2.0. → ~3.0. 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. → ^1.4.
core-js ^2.4. → ^2.5.
jquery ^3.1. → ^3.3.
karma-chrome-launcher ^2.0. → ^2.2.
karma-jasmine ^1.0. → ^1.1. 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. → ^6.1.
@angular/compiler ^2.3. → ^6.1.
@angular/core ^2.3. → ^6.1.
@angular/forms ^2.3. → ^6.1.
@angular/http ^2.3. → ^6.1.
@angular/platform-browser ^2.3. → ^6.1.
@angular/platform-browser-dynamic ^2.3. → ^6.1.
@angular/router ^3.3. → ^6.1.
angular2-jwt ^0.1. → ^0.2.
bootstrap ^3.3. → ^4.1.
rxjs ^5.0. → ^6.2.
zone.js ^0.7. → ^0.8.
@angular/cli 1.0.-rc. → 6.1.
@angular/compiler-cli ^2.3. → ^6.1.
@types/jasmine 2.5. → 2.8.
@types/node ^6.0. → ^10.5.
codelyzer ~2.0.-beta. → ~4.4.
jasmine-core 2.5. → 3.2.
jasmine-spec-reporter 2.5. → 4.2.
karma 1.2. → 3.0.
karma-remap-istanbul ^0.2. → ^0.6.
protractor ~4.0. → ~5.4.
ts-node 1.2. → 7.0.
tslint ^4.3. → ^5.11.
typescript ~2.0. → ~3.0.
ace-builds ^1.2. → ^1.4.
core-js ^2.4. → ^2.5.
jquery ^3.1. → ^3.3.
karma-chrome-launcher ^2.0. → ^2.2.
karma-jasmine ^1.0. → ^1.1.
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. → ^1.4.
core-js ^2.4. → ^2.5.
jquery ^3.1. → ^3.3.
karma-chrome-launcher ^2.0. → ^2.2.
karma-jasmine ^1.0. → ^1.1.
Upgraded /home/hanshanyang/Projects/bittigercs503/week3/oj-client/package.json hanshanyang@hanshanyang-VirtualBox:~/Projects/bittigercs503/week3/oj-client$

然后 sudo npm install

来安装

相关文章