0

Following the instruction for setting up grunt angular templates: https://npmjs.org/package/grunt-angular-templates

I install the grunt-angular-template by doing:

npm install grunt-angular-templates --save-dev

It installs.

My package.json is just a very simple:

{
  "name": "grunt_example2",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "grunt-angular-templates": "~0.4.7"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "BSD-2-Clause"
}

And I create a Gruntfile.js as

module.exports = function(grunt) {
  grunt.loadTasks('grunt-angular-templates');
}

when I do:

grunt ngtemplates

I get: 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

But that gives me nothing on how to resolve this.

Any tips?

Thanks.

Breako Breako
  • 6,353
  • 14
  • 40
  • 59
  • http://stackoverflow.com/questions/13925916/fatal-error-unable-to-find-local-grunt/13927654#13927654 , this may help. – Anshul Dec 30 '13 at 10:42

1 Answers1

1

You need to install grunt into your project. See here: http://gruntjs.com/getting-started#installing-grunt-and-gruntplugins

npm install grunt --save-dev

badsyntax
  • 9,394
  • 3
  • 49
  • 67
  • but why does it have to be local? I want to do sudo npm install -g grunt – FutuToad Jan 23 '14 at 12:47
  • 1
    @FutuToad You need 'grunt-cli' installed globally (which will create the 'grunt' application), then you need to install 'grunt' locally to run the tasks. Please, read the documentation. – badsyntax Jan 23 '14 at 14:34
  • gotcha! but its pretty weird needing to istall everything locally – FutuToad Jan 24 '14 at 09:43