7

我使用Homebrew安装 Node.js,然后使用npm install安装 Grunt 及其依赖项,但安装完成后,我无法运行 Grunt:

zsh: correct 'grunt' to 'grn' ÆnyaeÅ? n
zsh: command not found: grunt

安装 Grunt 的正确方法是什么,所以我没有收到此错误?

4

2 回答 2

21

要在命令行上使用 Grunt,您必须安装命令行界面:

npm install -g grunt-cli

-g标志用于全局安装模块,这也将为 Grunt 创建一个 PATH 变量。

于 2013-09-22T05:01:04.363 回答
3
npm install -g grunt-cli   => This will put the grunt command in your system path
于 2013-09-28T05:47:10.077 回答