使用咕嘟咕嘟4和配方分裂我的任务为使用大口集线器的多个文件刚刚从尝试加载任务文件抛出这个错误.任务文件非常简单,只是想测试一切正常.
我在Github上的Undertaker上找到了这个关于get函数的引用,但我真的不明白他们想说的是什么,看起来像gulp-hub应该是在解除它.
其他人遇到这个并知道如何解决它?
Gulp文件
'use strict';
var gulp = require('gulp');
var HubRegistry = require('gulp-hub');
// Load some files into the registry
var hub = new HubRegistry(['gulp/tasks/*.js']); // only one file help.js
// Tell gulp to use the tasks just loaded
gulp.registry(hub);
Run Code Online (Sandbox Code Playgroud)
帮助任务 - /gulp/tasks/help.js
'use strict';
var gulp = require('gulp');
gulp.task('help', []);
Run Code Online (Sandbox Code Playgroud)
错误抛出
$ gulp help
[01:36:37] Loading gulp\tasks\help.js
D:\projects\app\node_modules\undertaker\lib\helpers\validateRegistry.js:36
throw err;
^
AssertionError: Custom registry must have `get` function
at validateRegistry (D:\projects\app\node_modules\undertaker\lib\helpers\validateRegistry.js:28:5)
at Gulp.registry (D:\projects\app\node_modules\undertaker\lib\registry.js:17:3)
at Object.<anonymous> (D:\projects\app\gulpfile.js:11:6)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
Run Code Online (Sandbox Code Playgroud)
Sve*_*ung 11
你可能正在运行gulp-hub@0.8.0哪个是当前发布到npm的版本,并且是为gulp 3.x设计的.
对于gulp 4.x,您需要gulp-hub从GitHub上的一个开发分支安装.目前有4.0和registry-init.
该4.0分支,因为它未能在目前不工作的注册表审定的undertaker.
registry-init然而,该分支似乎有效.你可以像这样安装它:
npm uninstall gulp-hub
npm install --save-dev frankwallis/gulp-hub#registry-init
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2463 次 |
| 最近记录: |