11

I have been trying to install Grunt. When I run grunt I receive the following list of messages and warnings:

Local Npm module "grunt-contrib-copy" not found.  Is it installed?
Local Npm module "grunt-contrib-uglify" not found.  Is it installed?
Local Npm module "grunt-contrib-jshint" not found.  Is it installed?
Local Npm module "grunt-contrib-less" not found.  Is it installed?
Local Npm module "grunt-contrib-clean" not found.  Is it installed?
Local Npm module "grunt-contrib-watch" not found.  Is it installed?
Local Npm module "grunt-contrib-concurrent" not found.  Is it installed?
Local Npm module "grunt-contrib-nodemon" not found.  Is it installed?
Local Npm module "grunt-contrib-newer" not found.  Is it installed?
Warning: Task "copy:vendor" not found. Use --force to continue.
Aborted due to warnings.

I have tried "npm install", "npm install grunt --save-dev", "grunt init:node". to fix the problem; it didn't work. Can anyone help? Thanks.

Brian
  • 448
  • 2
  • 6
  • 18

3 Answers3

12

It seems that you don't have loaded the modules in the Gruntfile.js or you haven't installed all the modules. Try npm install <module-name> --save-dev for all the modules.

VDarricau
  • 2,699
  • 2
  • 19
  • 24
  • Here is my Gruntfile.js: – Brian Jul 20 '15 at 03:48
  • There are node_modules folder, Gruntfile.js, and package.json. I am not permitted to enter codes for Gruntfile.js and package.json since there are too many codes. What modules are missing that I should install? Are they called, e.g., "copy" or "uglify"? In package.json, e.g., I see – Brian Jul 20 '15 at 03:56
  • Try `npm install grunt-contrib-copy --save-dev` and tell me if the error message has changed. – VDarricau Jul 20 '15 at 04:00
  • I could install all of them. When I run grunt, I receive file error: '. . /vendor/bootstrap/less/mixins.less' wasn't found. I've got some info regarding fixing this error, so I will try it. – Brian Jul 20 '15 at 04:13
  • I copied and pasted @import "../vendor/bootstrap/less/variables.less"; in public/less/bootstrap-build.less on line 3, but when I run grunt I am getting the same message. – Brian Jul 20 '15 at 04:27
  • Are you sure the file exists? – VDarricau Jul 20 '15 at 04:29
  • Yes, it does exist; I entered it as it should be. Yet I am getting the same error message as before. – Brian Jul 20 '15 at 04:38
  • I am really sorry I don't see what is the problem. You should post another question on that matter. – VDarricau Jul 20 '15 at 04:41
  • 2
    There is a case that your last 'npm install' failed, so some of the module is not successfully installed, but npm think they are successfully installed. you can try to remove the whole node_modules folder and run 'npm install' to re-install all the modules, if you have the right package.json file. – sayume Jul 20 '15 at 06:18
1

Running grunt need a package.json and Gruntfile.js files. Keep the file package.json and Gruntfile in the root directory of the project. After that, It will work.

Error:

enter image description here

After Keep the file package.json and Gruntfile in the root directory:

enter image description here

Sridhar
  • 401
  • 7
  • 10
1

In my case, node_modules was in parent directory of gruntFile.js
Odd one, might be helpful

Siva Kannan
  • 2,237
  • 4
  • 27
  • 39