导致此错误的原因是什么 - “致命错误:无法找到本地咕噜声” [英] What is causing this error - "Fatal error: Unable to find local grunt"

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

问题描述

我首先删除了旧版本的grunt,然后我安装了新的grunt版本,然后我收到了这个错误:

I removed the old version of grunt first, then I installed the new grunt version, and then I got this error:


D :\ www!#runt-test \ grunt grunt-cli:grunt命令行界面。
(v0.1.4)

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

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

Fatal error: Unable to find local grunt.

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

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

这是因为我的系统路径中没有对grunt的引用吗?或者是其他东西?我已经尝试重新安装了几次。

Is this because there is not a reference to grunt in my system path? Or something else? I tried to re-install it a few times already.

推荐答案

我认为你没有 grunt.js 项目目录中的文件。使用 grunt:init ,它为您提供诸如 jQuery,node,commonjs 等选项。选择你想要的,然后继续。这确实有效。有关详细信息,请访问

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.

执行此操作:

 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.).

它应该有用。

解决方案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.)

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

 npm install grunt --save-dev

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

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