![](/img/trans.png)
[英]grunt - getting “Local Npm module ”xxx“ not found. Is it installed?” What's causing this?
[英]Local Npm module “GRUNT-PLUGIN-MODULE” not found. Is it installed? What's causing this?
如何將新的grunt-plugin模塊加載到項目中。
目錄結構示例:
|-- 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
\-- ...
my-grunt-plugin
目錄中運行npm link
命令。 abc-project
dir中運行npm link my-grunt-plugin
命令來鏈接本地grunt插件模塊。 grunt task-a
命令,它將記錄Local Npm module "my-grunt-plugin" not found. Is it installed?
Local Npm module "my-grunt-plugin" not found. Is it installed?
在這種情況下,問題是my-grunt-plugin
的任務目錄名稱。 您需要確保task dir的名稱始終是tasks
NOT grunt-tasks
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.