致命错误:无法找到本地咕噜声 [英] Fatal error: Unable to find local grunt

查看:110
本文介绍了致命错误:无法找到本地咕噜声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我先删除旧的grunt,然后安装新的grunt.But,但出现错误:
$ b


D:\www \ grunt-test \ grunt grunt-cli:咕噜的命令行界面。
(v0.1.4)



致命错误:无法找到本地咕噜声。

如果您看到这条消息,Gruntfile没有找到或者
grunt没有被本地安装到你的项目中。有关安装和配置grunt的更多
信息,请参阅
入门指南: http:/ /gruntjs.com/getting-started


在我的系统路径中还是没有咕噜声,或其他的东西?我试着重新安装它几次。 我认为你没有 grunt.js 文件在您的项目目录中。使用 grunt:init ,它提供诸如 jQuery,node,commonjs 之类的选项。选择你想要的,然后继续。这真的有用。有关更多信息,请访问

执行此操作:

  1. npm install -g grunt 
2. grunt:init(你将得到以下选项):
jquery:一个jQuery插件
node:一个Node模块
commonjs:一个CommonJS模块
gruntplugin:一个Grunt插件
gruntfile:一个Gruntfile(grunt.js)
3.grunt init:jquery(如果你想创建一个与jQuery相关的项目)。

它应该有效。

v1.4:

  1。 npm install -g grunt-cli 
2. npm init
填写所有的细节,它会创建一个package.json文件。
3. npm install grunt(for grunt dependencies。)

编辑:已更新新版本的解决方案:

  npm install grunt --save-dev 


I removed the old grunt first,and I install the new grunt.But I got an error:

D:\www\grunt-test\grunt grunt-cli: The grunt command line interface. (v0.1.4)

Fatal error: Unable to find local grunt.

If you're seeing this message, either a Gruntfile wasn't found or grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: http://gruntjs.com/getting-started

Is there haven't a grunt in my system path, or something else? I tried to re-install it for few times.

解决方案

I think you don't have a grunt.js file in your project directory. Use grunt:init, which gives you options such as jQuery, node,commonjs. Select what you want, then proceed. This really works. For more information you can visit this.

Do this:

 1. npm install -g grunt
 2. grunt:init  ( you will get following options ):
      jquery: A jQuery plugin
      node: A Node module
      commonjs: A CommonJS module
      gruntplugin: A Grunt plugin
      gruntfile: A Gruntfile (grunt.js)
 3 .grunt init:jquery (if you want to create a jQuery related project.).

It should work.

Solution for v1.4:

1. npm install -g grunt-cli
2. npm init
   fill all details and it will create a package.json file.
3. npm install grunt (for grunt dependencies.)

Edit : Updated solution for new versions:

 npm install grunt --save-dev

这篇关于致命错误:无法找到本地咕噜声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆