In this tutorial, we shall learn to install Mongoose package using npm (Node Package Manager).
It is assumed that you have already installed Node.js and MongoDB. If incase not, then you may refer the below links.
To install Mongoose package, use npm (Node Package Manager). Open a terminal and run the following command :
|$ npm installmongoose|
$ npm install mongoose
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN firstname.lastname@example.org No repository field.
added 20 packages in 3.936s
To use Mongoose in Node.js Script File, include require statement with mongoose package.
var mongoose = require('mongoose');
In this tutorial, we have learnt how to install a Mongoose package and start using its reference.