I installed mongoose using
sudo npm install -g mongoose
Please advice on how I can check to see if its installed properly. I am using Mac
To check if mongoose
module is installed simply find the version by
npm list mongoose
To check globally
npm list -g mongoose
Mongoose is a npm module. Mongodb may or may not be installed.
To check whether mongodb is installed:
which mongo
To install mongodb locally:
brew install mongodb
Then follow the post-installation instructions.
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Test your connection to mongodb.
mongosh
If you are using MongoLab, to connect to database type: mongo
If you are running Mongo locally, start the Mongo daemon:
In the terminal type: mongod
If that doesnt run try: sudo mongod
Once mongoDB is running open another terminal window and type: mongo
In the same window type: show dbs
To work with a database in the list named myDB, for example type : use myDB
Two ways to check whether mongoose is install in your ubuntu/debian.
a) check locally( means into your project directory within node_modules)
For local - npm list mongoose
b) check globally( means in your OS within node_modules ).
For global check- npm list -g mongoose
It will show you the version of mongoose, if it already installed. If not then this will show this-
/home//.nvm/versions/node/v6.11.0/lib └── (empty) npm ERR! code 1
To install mongoose in ubuntu/debian, run this command in terminal - npm install --save mongoose
Also, if you used Homebrew you can check like:
mongod --version
mongos --version
mongosh --version
and for start(on Apple M1 chip) mongodb manually:
mongod --config /opt/homebrew/etc/mongod.conf --fork
mongosh
and for show the databases:
show dbs
use npm list mongoose if mongoose is not installed you will get this respose `-- (empty)