【发布时间】:2020-12-11 09:12:19
【问题描述】:
试图在我的命令行中运行grunt,但我得到zsh: command not found: grunt。
在我的项目目录中,我运行了npm install -g grunt-cli,按照咕噜声documentation。我试过运行npm install 和npm install grunt --save-dev。我仍然得到相同的结果。
我尝试过的选项:
- 将 grunt 作为插件添加到 zsh
- 将
/usr/local/share/npm/bin/添加到$PATH,指定为here - Hongkiat 上this article 中的解决方案(“解决终端中的 Grunt “Command Not Found”错误 [Quickfix]”)。这里有一个命令已被弃用。
- 正在尝试
sudo npm install -g grunt-cli
这些都不起作用。关于如何让 grunt 工作的任何提示?
我的系统:
- Mac OS v10.11
- npm v5.6.0
- 节点 v8.9.4
- zsh 5.0.8
【问题讨论】:
-
您是否在全球范围内安装了
grunt?否则我不希望它出现在/usr/local/share/npm/bin中。您是否还查看了the question you linked 中的其他答案? -
@Adaephon 是的,我更新了问题以包含此信息。