Gulp 降级后无法使用
Gulp not working after downgrade
安装 gulp#4
(gulp npm install 'gulpjs/gulp.git#4.0' --save-dev
的下一个版本)后,我进行了几次测试并最终进入了最新版本,但控制台一直在向我打印以下输出 AssertionError [ERR_ASSERTION]: Task function must be specified
我尝试了几种方法,例如更改分支、删除 node_modules
和安装不同的 gulp 版本,例如 gulp@3 但 none 工作
$ npm run watch
> cx-content-extractor@0.0.1 watch /Users/alevale/work/CLIENT
> gulp watch
assert.js:60
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/Users/alevale/work/CLIENT/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/Users/alevale/work/CLIENT/node_modules/undertaker/lib/task.js:13:8)
at /Users/alevale/work/CLIENT/gulpfile.js:43:10
at Object.<anonymous> (/Users/alevale/work/CLIENT/gulpfile.js:168:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cx-content-extractor@0.0.1 watch: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cx-content-extractor@0.0.1 watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alevale/.npm/_logs/2017-07-20T12_28_19_935Z-debug.log
想分享我的愚蠢错误^^
经过几次尝试后,我所做的更改似乎已保存在 package-lock.json
中,而我在 "clean state"[=11= 中获取环境时也忘记删除该文件]
安装 gulp#4
(gulp npm install 'gulpjs/gulp.git#4.0' --save-dev
的下一个版本)后,我进行了几次测试并最终进入了最新版本,但控制台一直在向我打印以下输出 AssertionError [ERR_ASSERTION]: Task function must be specified
我尝试了几种方法,例如更改分支、删除 node_modules
和安装不同的 gulp 版本,例如 gulp@3 但 none 工作
$ npm run watch
> cx-content-extractor@0.0.1 watch /Users/alevale/work/CLIENT
> gulp watch
assert.js:60
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/Users/alevale/work/CLIENT/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/Users/alevale/work/CLIENT/node_modules/undertaker/lib/task.js:13:8)
at /Users/alevale/work/CLIENT/gulpfile.js:43:10
at Object.<anonymous> (/Users/alevale/work/CLIENT/gulpfile.js:168:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cx-content-extractor@0.0.1 watch: `gulp watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cx-content-extractor@0.0.1 watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/alevale/.npm/_logs/2017-07-20T12_28_19_935Z-debug.log
想分享我的愚蠢错误^^
经过几次尝试后,我所做的更改似乎已保存在 package-lock.json
中,而我在 "clean state"[=11= 中获取环境时也忘记删除该文件]