npm install global删除并重新安装依赖项,有没有办法只安装缺少的依赖项?

时间:2015-01-23 08:35:05

标签: node.js npm

我什么时候在我的项目中运行“npm install -g”。

NPM删除/ usr / local / lib / node_modules / {projectName} / node_modules下的所有文件/目录,并再次下载。

有没有一种方法,npm只更新或下载新的依赖项?

********************编辑********************

这是我的package.json

{
    "name"            : "someName",
    "version"         : "0.0.1",
    "engines"         : {
        "node" : "0.10.x",
        "npm"  : "1.4.x"
    },
    "dependencies"    : {
        "assetmanager"           : "1.0.0",
        "async"                  : "0.9.0",
        "body-parser"            : "1.2.0",
        "bower"                  : "1.3.3",
        "compression"            : "1.0.1",
        "connect-flash"          : "0.1.1",
        "connect-redis"          : "2.0.0",
        "consolidate"            : "0.10.0",
        "cookie-parser"          : "1.1.0",
        "csurf"                  : "1.4.0",
        "dependable"             : "0.2.5",
        "errorhandler"           : "1.0.0",
        "express"                : "4.2.0",
        "express-session"        : "1.1.0",
        "express-validator"      : "2.1.1",
        "forever"                : "0.11.1",
        "gridfs-stream"          : "0.5.1",
        "grunt-cli"              : "0.1.13",
        "grunt-concurrent"       : "0.5.0",
        "grunt-contrib-clean"    : "0.5.0",
        "grunt-contrib-csslint"  : "0.2.0",
        "grunt-contrib-cssmin"   : "0.9.0",
        "grunt-contrib-jshint"   : "0.10.0",
        "grunt-contrib-uglify"   : "0.4.0",
        "grunt-contrib-watch"    : "0.6.1",
        "grunt-env"              : "0.4.1",
        "grunt-nodemon"          : "0.2.1",
        "load-grunt-tasks"       : "0.4.0",
        "lodash"                 : "2.4.1",
        "mean-connect-mongo"     : "0.4.3",
        "mean-logger"            : "0.0.1",
        "meanio"                 : "0.4.x",
        "method-override"        : "1.0.0",
        "mongoose-schema-extend" : "0.1.7",
        "mongoose"               : "3.8.8",
        "morgan"                 : "1.0.0",
        "node-redis-warlock"     : "0.0.6",
        "nodemailer"             : "0.7.0",
        "nodetime"               : "0.8.15",
        "passport"               : "0.2.0",
        "passport-local"         : "1.0.0",
        "pbkdf2-sha256"          : "1.0.1",
        "redis-sentinel"         : "0.1.3",
        "request"                : "2.47.0",
        "serve-favicon"          : "2.0.1",
        "should"                 : "3.3.1",
        "swig"                   : "1.3.2",
        "time-grunt"             : "0.3.1",
        "twilio"                 : "1.6.0",
        "view-helpers"           : "0.1.4",
        "winston"                : "0.7.3",
        "ua-parser"              : "0.3.4"
    }
}

现在我跑“npm -g install”

在另一个标签上我运行:

ls -lrt /usr/local/lib/node_modules/afv/node_modules | wc -l

上面的输出从54开始并且变为0然后返回到54

0 个答案:

没有答案