When I run Grunt, I receive the following message: Local npm module "grunt-contrib-copy" not found. Is it installed?
Asked Answered
P

3

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.

Perfectible answered 20/7, 2015 at 2:39 Comment(2)
Is there a package.json file? Is there a node_modules folder?Dianthe
Can you show your Gruntfile.js and package.json?Pastoralist
P
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.

Pastoralist answered 20/7, 2015 at 2:56 Comment(9)
Here is my Gruntfile.js:Perfectible
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 seePerfectible
Try npm install grunt-contrib-copy --save-dev and tell me if the error message has changed.Pastoralist
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.Perfectible
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.Perfectible
Are you sure the file exists?Pastoralist
Yes, it does exist; I entered it as it should be. Yet I am getting the same error message as before.Perfectible
I am really sorry I don't see what is the problem. You should post another question on that matter.Pastoralist
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.Murther
U
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

Urbani answered 24/10, 2018 at 10:19 Comment(0)
D
1

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

Disinfect answered 8/1, 2019 at 14:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.