Node.js “本地Npm模块”;GRUNT-PLUGIN-MODULE“;没有找到。安装了吗?什么';是什么原因造成的?
如何将新的grunt插件模块加载到项目中 dir结构的示例:Node.js “本地Npm模块”;GRUNT-PLUGIN-MODULE“;没有找到。安装了吗?什么';是什么原因造成的?,node.js,gruntjs,npm,grunt-plugins,Node.js,Gruntjs,Npm,Grunt Plugins,如何将新的grunt插件模块加载到项目中 dir结构的示例: |-- abc-project | |-- ... | |-- app.js | |-- Gruntfile.js --> `grunt.loadNpmTasks('my-grunt-plugin');` | \-- package.json | \-- my-grunt-plugin |-- grunt-tasks | |-- task-a.j
|-- 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
\-- ...
- 在
mygrunt插件中运行
命令李>npm-link
- 通过运行
abc项目中的
命令链接本地grunt插件模块李>npm link my grunt plugin
- 运行
命令,它将记录grunt任务-a
本地Npm模块“我的grunt插件”未找到。是否已安装?
- 通过运行
我的grunt插件中的任务目录名。
您需要确保task dir的名称始终为tasks
而不是grunt tasks
在我的项目(任何任务)上运行grunt
时,我会遇到同样的错误。它似乎刚刚开始出现。我看到未找到本地Npm模块“grunt插件”。安装了吗?
在我的节点\u模块中有一个grunt插件
文件夹。我尝试了从该文件夹中删除npm链接,也尝试了删除该文件夹。这对我来说很有效,尽管我似乎有不同的问题(请参阅我对该问题的评论)。简单地做了一个mkdir节点\u modules/grunt plugin/tasks
,我再也看不到警告了!奇怪,但很高兴它修好了。