简体   繁体   English

mongodb在Linux node.js上安装错误

[英]mongodb install error on linux node.js

I'm trying to install MongoDB with node.js on linux. 我正在尝试在Linux上使用node.js安装MongoDB。 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 我使用命令npm install mongodb --save安装了它,我可以在packages.json文件中找到mongdb依赖性,但是当我使用mongod,mongodb或mongo命令时出现错误

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. 您的错误是您正在为mongoDB安装node.js客户端,但尝试在shell中启动mongodb服务器。

In order to use mongod command you should install mongodb server itself. 为了使用mongod命令,您应该安装mongodb服务器本身。

Follow this tutorial to install mongoDB in Ubuntu. 按照本教程的说明在Ubuntu中安装mongoDB。

when you run npm install mongodb --save , you just install the drivers to connect mongodb and your application. 运行npm install mongodb --save ,只需安装驱动程序以连接mongodb和您的应用程序。 You can download the mongodb server from the official site here 您可以从此处的官方网站下载mongodb服务器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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