找不到 Mongod 命令(Windows7)(node.js)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30835302/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 18:51:56  来源:igfitidea点击:

Mongod command not found (Windows7)(node.js)

node.jsgitbashmongodb

提问by Tristan Marr

I have been trying to get my mongodb going for about a day now. The problem seems to be that the mongod command is not found. I have the npm package mongoose installed in my node.js build. When i try to start the server with the mongod command the git bash returns that the command is not found.

我一直试图让我的 mongodb 现在运行大约一天。问题似乎是找不到mongod命令。我在 node.js 构建中安装了 npm 包 mongoose。当我尝试使用 mongod 命令启动服务器时,git bash 返回未找到该命令。

I have been googleing for an answer and it looks like i need to make mongodb into a command, i'm not sure how to do this. Any advice would help.

我一直在谷歌上寻找答案,看起来我需要将 mongodb 变成一个命令,我不知道该怎么做。任何建议都会有所帮助。

I have downloaded the mongodb into my files it's located here C:\Program Files\MongoDB\Server\3.0 ( Not sure if that matters or not).

我已将 mongodb 下载到我的文件中,它位于 C:\Program Files\MongoDB\Server\3.0(不确定这是否重要)。

Really not sure what to do from here.

真的不知道从这里做什么。

回答by Peter Kulik

Add the mongo's path to the Path environment variable: https://youtu.be/sBdaRlgb4N8?t=120

在Path环境变量中添加mongo的路径:https://youtu.be/sBdaRlgb4N8?t =120

回答by Sunil_18

You need to use ./to run mongod.exefile. use ./mongod.exeIt'll run successfully.

您需要使用./来运行mongod.exe文件。使用./mongod.exe它会成功运行。

回答by AN Jay

When you open the bin folder it has a file called mongod.pdbinstead of mongod.exeBut don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin) you are allowing the computer to run the executable files in that particular folder.

当您打开 bin 文件夹时,它有一个名为mongod.pdb的文件而不是mongod.exe但别担心。可以通过将路径添加到环境变量来纠正它。通过附加 bin 文件夹的路径 ( C:\Program Files\MongoDB\Server\3.4\bin),您允许计算机运行该特定文件夹中的可执行文件。

回答by AN Jay

Set the path variable.When you open the bin folder it has a file called mongod.pdbinstead of mongod.exeBut don't worry. It could be rectified by adding the path to the environment variables. By appending the path of the bin folder (C:\Program Files\MongoDB\Server\3.4\bin)you are allowing the computer to run the executable files in that particular folder.

设置路径变量。当您打开 bin 文件夹时,它有一个名为mongod.pdb的文件而不是mongod.exe但别担心。可以通过将路径添加到环境变量来纠正它。通过附加 bin 文件夹的路径(C:\Program Files\MongoDB\Server\3.4\bin),您允许计算机运行该特定文件夹中的可执行文件。

shutting down with code:100

使用代码关闭:100

When you run mongod.exeif the DB is shutting down with code:100, then you need to make two folders (data and db) to create databases. Use mkdir C:\data\db

当您运行mongod.exe 时,如果数据库以代码:100 关闭,那么您需要创建两个文件夹(data 和 db)来创建数据库。使用 mkdir C:\data\db