I think you don't have a grunt.js
file in your project directory.
(我认为你的项目目录中没有grunt.js
文件。)
Use grunt:init
, which gives you options such as jQuery, node,commonjs
.(使用grunt:init
,它为您提供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:
(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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…