[ACCEPTED]-grunt - getting "Local Npm module "xxx" not found. Is it installed?" What's causing this?-gruntjs

Accepted answer
Score: 65

You probably haven't installed necessary 2 packages locally. Try npm install (sudo npm install) to make sure you 1 did that.

Score: 12

If the accepted answer doesn't work AND 3 you have a correct package.json file, you can:

  1. delete 2 the node_modules folder (or back it up somewhere)

  2. and 1 then run npm install

in order to get a fresh start.

Score: 1

You have to tell grunt where to find node_modules. My 3 Gruntfile starts with:

module.exports = function (grunt) {
    // Tell grunt where to find node_modules
    grunt.file.setBase('../../../../../');
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-hub');

In my case, node_modules 2 folder is 5 levels upper (look at setBase 1 method) than Gruntfile.

More Related questions