Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I just received a copy of a grunt package to work on, but I'm new to grunt and am having trouble finding answers to a few things. The biggest issue is not knowing where the errors below are coming from - can someone tell me where this is coming from? Both of these files are in the same directory.

$ grunt >> Local Npm module "grunt-contrib-clean" not found. Is it installed? >> Local Npm module "grunt-contrib-concat" not found. Is it installed? >> Local Npm module "grunt-contrib-copy" not found. Is it installed? >> Local Npm module "grunt-contrib-cssmin" not found. Is it installed? >> Local Npm module "grunt-contrib-handlebars" not found. Is it installed? >> Local Npm module "grunt-contrib-jshint" not found. Is it installed? >> Local Npm module "grunt-contrib-qunit" not found. Is it installed? >> Local Npm module "grunt-contrib-uglify" not found. Is it installed? >> Local Npm module "grunt-preprocess" not found. Is it installed? >> Local Npm module "grunt-wrap" not found. Is it installed? >> Local Npm module "grunt-debug-task" not found. Is it installed? Warning: Task "clean" not found.  Use --force to continue.  Aborted due to warning.  $ 

And here is my package.json:

{   "name": "baked-widget",     "srcDirectory": "./src",     "srcJavascript": "./src/js",     "srcCss": "./src/css",     "srcData": "./src/data",     "testDirectory": "./test",     "tgtDirectory": "./build",     "installDirectory": "../com/public/widgets",   "version": "4.2.0",   "devDependencies": {     "grunt": "~0.4",     "grunt-contrib-clean": "~0.4.0",     "grunt-contrib-concat": "~0.3.0",     "grunt-contrib-copy": "~0.5.0",     "grunt-contrib-cssmin": "~0.9.0",     "grunt-contrib-handlebars": "~0.6",     "grunt-contrib-jshint": "~0.8",     "grunt-contrib-uglify": "~0.3",     "grunt-contrib-qunit": "~0.4",     "grunt-contrib-watch": "~0.5",     "grunt-preprocess": "~4.0",     "grunt-wrap": "~0.3",     "grunt-debug-task": "~0.1.4"   } } 
like image 326
u353 Avatar asked May 20 '14 18:05

u353


People also ask

How do I force npm to install dependencies?

Install the dependencies to the local node_modules folder. In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package. By default, npm install will install all modules listed as dependencies in package.

Is grunt deprecated?

grunt. util. _ is deprecated and we highly encourage you to npm install lodash and var _ = require('lodash') to use lodash .


2 Answers

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

like image 71
zishe Avatar answered Sep 24 '22 02:09

zishe


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

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

  2. and then run npm install

in order to get a fresh start.

like image 27
wranvaud Avatar answered Sep 21 '22 02:09

wranvaud