我正在从gorestful那里倾斜Golang。
我正在尝试在Ubuntu 18.04上重现该项目。
如果我去
gulp
从命令行assert.js:42 引发新错误.AssertionError({ ^
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/home/milenko/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/home/milenko/node_modules/undertaker/lib/task.js:13:8)
at Object.<anonymous> (/home/milenko/go/src/github.com/MilenkoM/gulpfile.js:10:6)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
如何解决这个问题?
gulp -v
[19:51:51] CLI version 3.9.1
[19:51:51] Local version 4.0.0
我的gulpfile.js
var gulp = require("gulp");
var shell = require('gulp-shell');
// This compiles new binary with source change
gulp.task("install-binary", shell.task([
'go install github.com/MilenkoM/romanserver'
]));
// Second argument tells install-binary is a deapendency for restart-supervisor
gulp.task("restart-supervisor", ["install-binary"], shell.task([
'supervisorctl restart myserver'
]))
gulp.task('watch', function() {
// Watch the source code for all changes
gulp.watch("*", ['install-binary', 'restart-supervisor']);
});
gulp.task('default', ['watch']);
我的树
~/go/src/github.com/MilenkoM$ tree .
.
├── gulpfile.js
├── romanNumerals
│ └── data.go
└── romanserver
└── main.go