简体   繁体   中英

Adding express and Mongo for models and db schema

I am working on a web application and using grunt for managing tasks. This is the package.json file that I am using. Now I need to include express and mongodb schema for this application.

Using npm install express and npm install mongoose, will all the dependencies get installed automatically or should individual commands be used?

Help me out with this. Thanks.

{
  "name": "square",
  "version": "3.1.0",
  "devDependencies": {
    "connect-livereload": "~0.5.2",
    "grunt": "~0.4.5",
    "grunt-autoprefixer": "~3.0.0",
    "grunt-concurrent": "~2.1.0",
    "grunt-contrib-clean": "~0.7.0",
    "grunt-contrib-coffee": "~0.13.0",
    "grunt-contrib-compass": "~1.0.0",
    "grunt-contrib-concat": "~0.5.0",
    "grunt-contrib-connect": "^0.11.2",
    "grunt-contrib-copy": "~0.8.0",
    "grunt-contrib-cssmin": "~0.14.0",
    "grunt-contrib-htmlmin": "~0.6.0",
    "grunt-contrib-jade": "~0.15.0",
    "grunt-contrib-jshint": "~0.11.0",
    "grunt-contrib-less": "~1.1.0",
    "grunt-contrib-uglify": "~0.11.0",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-injector": "^0.6.1",
    "grunt-open": "~0.2.3",
    "grunt-usemin": "~3.1.0",
    "jshint-stylish": "^2.1.0",
    "load-grunt-tasks": "~3.4.0",
    "time-grunt": "~1.3.0",
    "serve-static": "^1.10.0",
    "http-errors": "^1.3.1",
    "debug": "^2.2.0",
    "depd": "^1.1.0",
    "destroy": "^1.0.3",
    "range-parser": "^1.0.3",
    "mime": "^1.3.4",
    "fresh": "^0.3.0",
    "etag": "^1.7.0",
    "ms": "^0.7.1",
    "on-finished": "^2.3.0",
    "statuses": "^1.2.1"    
  },
  "engines": {
    "node": ">=0.10.0"
  }
}

You can use

npm install express --save-dev 
npm install mongoose --save-dev 

This will save to your devDepencies list in the package.json file. Any dependencies that express or mongoose need will automatically be installed when you install each.

use following commands:

npm install express --save
npm install mongoose --save

this will install all dependencies to package.json and if you want to install them on other system you can use

npm install

this will install all dependencies mentioned in package.json.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM