Mongoose Installation

How to install mongoose using npm

"npm" is a tool avaiable to install mongoose

>_ Use this command in Command prompt/Shell

npm install mongoose

>_ Install Mongoose in Custom Location

If we need the mongoose libraries in our custom directory then do as below.

  1. Create a package.json file and palce this code in that file
"name" : "MyMongoose",
"dependencies" : {
	"express" : "~4.8.8",
	"morgan": "~1.3.0",
	"compression": "~1.0.11",
	"body-parser": "~1.8.0",
	"method-override": "~2.2.0",
	"mongodb": "~2.1",
	"mongoose": "~3.8.15"
  1. Now use this command from the command prompt (where the package.json is exist)
       npm install
       npm update
  2. Now a folder named “node_modules” will be created with above dependencies