Grunt命令行无效

时间:2016-07-27 14:48:31

标签: gruntjs

当我尝试运行时

  

$ grunt

显示此错误

  

致命错误:无法找到当地的咕噜声

我已使用此命令在我的项目中安装了grunt

  
    

npm install -g grunt-cli

  

任何人都可以告诉我我做错了什么吗?

1 个答案:

答案 0 :(得分:0)

尝试使用sudo,因为有时只是因为访问权限问题。还要检查是否在项目的根目录中运行该命令。

所以试试

  

sudo npm install -g grunt-cli

通过运行

安装grunt-cli之前更新现有的npm也可能是个好主意
  

npm update -g npm