2013-10-25 92 views
0

我使用Yeoman創建和管理我的應用程序; 創建應用程序後,在應用程序的文件夾中安裝了多個node_modules(bower,grunt,grunt-cli ...)Yeoman - 更新應用程序文件夾中的節點模塊

如果我希望將所有此節點模塊更新爲各自的最新版本,我該怎麼做版本?

現在我手動去節點模塊的文件夾內,然後運行

npm update 

一個接一個;但我想知道是否有更好的方法來做到這一點...

Yeoman在項目的根文件夾中創建一個package.json;這裏的文件內容:

{ 
    "name": "webapp", 
    "version": "2.0.0", 
    "dependencies": {}, 
    "devDependencies": { 
    "grunt": "0.4.2-0", 
    "grunt-contrib-copy": "~0.4.1", 
    "grunt-contrib-concat": "0.3.0", 
    "grunt-contrib-coffee": "0.7.0", 
    "grunt-contrib-uglify": "0.2.4", 
    "grunt-contrib-compass": "0.5.0", 
    "grunt-contrib-jshint": "~0.4.1", 
    "grunt-contrib-cssmin": "~0.6.0", 
    "grunt-contrib-connect": "~0.2.0", 
    "grunt-contrib-clean": "~0.4.0", 
    "grunt-contrib-htmlmin": "~0.1.3", 
    "grunt-contrib-imagemin": "~0.1.3", 
    "grunt-contrib-livereload": "~0.1.2", 
    "grunt-rev": "~0.1.0", 
    "grunt-usemin": "~0.1.10", 
    "grunt-regarde": "~0.1.1", 
    "grunt-mocha": "~0.3.0", 
    "grunt-open": "~0.2.0", 
    "grunt-svgmin": "~0.1.0", 
    "grunt-concurrent": "~0.1.0", 
    "matchdep": "~0.1.1", 
    "grunt-ember-templates": "0.4.7", 
    "grunt-neuter": "0.5.0" 
    }, 
    "engines": { 
    "node": ">=0.8.0" 
    } 
} 

,但如果我跑NPM更新,它說,沒有「庫場」

回答

1

您可以直接在你的根項目文件夾叫「npm update」,就在你的包.json文件是。它將檢查所有本地和全局模塊中的更新。

Yeoman應該創建package.json,因此無論如何它都應該存在。

+0

我編輯了這個問題...是的,有一個package.json文件,但運行npm更新我得到一個錯誤(沒有存儲庫字段) –

+0

這很有趣,我剛剛打開一個package.json我的一個項目(不是用yeoman創建的),沒有指定一個存儲庫,它的工作原理非常好... – luschn

+0

也許問題是隻有一個特定的模塊?你有錯誤還是隻是一個警告?因爲一個警告,你可以忽略,看到這裏:https://github.com/isaacs/npm/issues/3568 – luschn

相關問題