导致此错误的原因是什么 - “致命错误:无法找到本地咕噜声”
我首先删除了旧版本的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