grunt init:节点不工作

我正在尝试做一个介绍咕噜教程。 我已经在全局安装了git,node.js和grunt(或者至less我以为我用过:npm install -g grunt(安装)),然后创build了一个快速目录并input它(mkdir demo,cd demo),但是当我input:

> grunt init:node 

在提示符下,我得到以下内容:

 grunt-cli: The grunt command line interface (v0.1.11) Fatal error: unable to find local grunt If you're seeing this message, either a Gruntfile wasn't found or 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

我看了看,并说它做我在做什么,教程提到什么? 任何想法我做错了什么? Node.js和Git工作正常,所以我只能假设它是咕噜声或安装失败。

谢谢

咕噜声你需要两个元素。 你用npm install -g grunt-cli了一个全局的grunt-cli,同时也是一个grunt本身的副本。 所以在你的项目文件夹安装这个与npm install grunt --saveDev这将安装一个本地grunt,并将其添加到您的devDependencies在您的package.json文件。 您还需要项目文件夹中的Gruntfile.js。 这是一个伟大的写作http://www.integralist.co.uk/Grunt-Boilerplate.html