gpt4 book ai didi

node.js - 即使添加到环境 PATH,命令提示符也无法识别 MongoDB

转载 作者:太空宇宙 更新时间:2023-11-03 23:33:31 26 4
gpt4 key购买 nike

我是 MEAN 堆栈的新手,正在尝试在这里实现教程:https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4

我只是想安装我需要的包,其中包括node.js、express、js 和 MongoDB。

尝试排除故障后我的步骤:

  1. I have installed MongoDB 3.2.1 from their site onto my local machine and it is stored at path C:\Program Files\MongoDB\Server\3.2\bin\

(I can navigate to C:\Program Files\MongoDB\Server\3.2\bin in my command prompt window and type mongo and have it run)

  1. I went to Control Panel -> System Settings -> Security -> Advanced -> Environment Varaibles -> and under system varialbles:

Earlier I had to add a path for node.js (C:\Program Files\nodejs works fine for running node at any directory level)

So I tried adding a system variable: MongoDB at "C:\Program Files\MongoDB\Server\3.2\bin\mongo"

因此,我的最终目标是能够导航到桌面上的文件夹结构并运行:

“Node --版本”“表达--版本”“蒙戈——版本”并让它们全部正确安装并可用,以便我可以继续创建应用程序。

如有任何帮助,我们将不胜感激,谢谢。

最佳答案

命令行通过查找 PATH 环境变量指定的所有目录来工作。

据我所知,当您只需要包含目录时,您已在 PATH 中包含了可执行文件 (mongo) 的名称。

为了完整起见,在我的电脑上,PATH 变量看起来像这样:

C:\Program Files (x86)\Python35-32\Scripts\;C:\Program Files\apache-maven-3.3.9\bin;C:\Program Files\MongoDB\Server\3.2\bin

Environment Variables

关于node.js - 即使添加到环境 PATH,命令提示符也无法识别 MongoDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35381956/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com