在OS X上安装Grunt

时间:2013-09-09 22:54:47

标签: node.js npm gruntjs

这是我到目前为止所做的:

brew install nodejs npm
npm install -g grunt

我还设置了包含正确目录的路径。当我运行echo $PATH时,我得到:

/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/lib/node:/usr/local/lib/node_modules:/usr/local/share/npm/bin:/usr/local/share/npm/lib/node_modules:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/landonschropp/.rbenv/shims:/usr/local/sbin:/usr/local/lib/node:/usr/local/lib/node_modules:/usr/local/share/npm/bin:/usr/local/share/npm/lib/node_modules:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

安装成功没有任何问题。但是,如果我尝试运行grunt,我会收到此错误:

zsh: permission denied: grunt

我错过了一步吗?

2 个答案:

答案 0 :(得分:38)

尝试安装命令行界面:

npm install -g grunt-cli

答案 1 :(得分:4)

sudo npm install -g grunt-cli然后输入您的密码。