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

家住魔仙堡 提交于 2019-12-07 02:59:25

问题


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.


回答1:


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.




回答2:


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:

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




回答3:


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



来源:https://stackoverflow.com/questions/31508137/when-i-run-grunt-i-receive-the-following-message-local-npm-module-grunt-contr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!