【发布时间】:2021-07-23 14:36:08
【问题描述】:
我在 windows 7 中安装了 nginx,位置是 C:\nginx。我可以从这个位置运行 nginx 命令,但不能从另一个位置运行 nginx 命令。将系统变量路径设置为C:\nginx\nginx.exe,但仍然无法从其他位置运行nginx命令。
我必须运行 nginx -c "E:\GitHub\central-frontend\nginx.conf" -p "E:\GitHub\central-frontend\dist" 或 nginx -c "%cd%\nginx.conf" -p "%cd%\dist" 从位置 E:\GitHub\central-frontend\ p>
现在当我从 E:\GitHub\central-frontend\ 运行此命令时,我收到此错误,
nginx : 术语“nginx”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名字的拼写, 或者如果包含路径,请验证路径是否正确并重试。 在 line:1 char:1
- nginx -c "%cd%\nginx.conf" -p "%cd%\dist"
-
+ CategoryInfo : ObjectNotFound: (nginx:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
【问题讨论】: