简体   繁体   中英

mongodb install error on linux node.js

I'm trying to install MongoDB with node.js on linux. I installed it with command npm install mongodb --save , I can find mongdb dependence in packages.json file but when I use commands mongod, mongodb or mongo I get error

bash: mongod: command not found

Please help me

Your mistake is you are installing a node.js client for mongoDB but trying to launch a mongodb server in a shell.

In order to use mongod command you should install mongodb server itself.

Follow this tutorial to install mongoDB in Ubuntu.

when you run npm install mongodb --save , you just install the drivers to connect mongodb and your application. You can download the mongodb server from the official site here

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