zoukankan      html  css  js  c++  java
  • 更新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 

    来安装

  • 相关阅读:
    Global.asax 文件是什么
    C和C++语言学习总结
    iphone窗口传值
    c语言实现队列
    iphone窗口跳转
    NSStirng、NSArray、 文件 以及枚举(Method小集合)
    服务器接受的链接过多,该怎么处理
    c语言实现单链表
    iphone开发 NSXMLParser解析xml文件
    iphone 切换界面
  • 原文地址:https://www.cnblogs.com/PoeticalJustice/p/9464959.html
Copyright © 2011-2022 走看看