2

How to load your new grunt-plugin module to your project.

example of dir structure:

|-- abc-project
|       |-- ...
|       |-- app.js
|       |-- Gruntfile.js --> `grunt.loadNpmTasks('my-grunt-plugin');`
|       \-- package.json
|
\-- my-grunt-plugin
      |-- grunt-tasks
      |       |-- task-a.js --> `grunt.registerTask('task-a', 'running task a', function() { ... });`
      |       \-- task-b.js
      \-- ...
  • run npm link command inside my-grunt-plugin dir.
  • link your local grunt plugin module by running npm link my-grunt-plugin command inside abc-project dir.
  • run grunt task-a command, it will log Local Npm module "my-grunt-plugin" not found. Is it installed?
Shadi Abu Hilal
  • 281
  • 1
  • 3
  • 7
  • I get this same error when I run `grunt` on my project (any task). It seems to have just started showing up. I see `Local Npm module "grunt-plugin" not found. Is it installed?` There was a `grunt-plugin` folder in my `node_modules`. I tried `npm link` from within that folder, and I also tried deleting the folder. – theUtherSide Feb 09 '16 at 19:30

1 Answers1

0

The issue in this case is the task dir name in the my-grunt-plugin. You need to make sure that the name of task dir is always tasks NOT grunt-tasks.

Shadi Abu Hilal
  • 281
  • 1
  • 3
  • 7
  • 1
    This worked for me, even though it seemed I had a different issue (see my comment on the question). Simply did a `mkdir node_modules/grunt-plugin/tasks` and I no longer see the warning! Strange, but glad it's fixed. – theUtherSide Feb 09 '16 at 19:34