[ACCEPTED]-grunt - getting "Local Npm module "xxx" not found. Is it installed?" What's causing this?-gruntjs
Accepted answer
You probably haven't installed necessary 2 packages locally. Try npm install
(sudo npm install
) to make sure you 1 did that.
If the accepted answer doesn't work AND 3 you have a correct package.json
file, you can:
delete 2 the
node_modules
folder (or back it up somewhere)and 1 then run
npm install
in order to get a fresh start.
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.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.