简体   繁体   English

降级后,Gulp无法正常工作

[英]Gulp not working after downgrade

After installing gulp#4 (the next version of gulp npm install 'gulpjs/gulp.git#4.0' --save-dev ) I was doing a couple of tests and ended up going to the last version but the console kept printing me the following output AssertionError [ERR_ASSERTION]: Task function must be specified I've tried several things like changing branch, removing the node_modules and installing a different gulp version like gulp@3 but none work 安装gulp#4 (下一版npm install 'gulpjs/gulp.git#4.0' --save-dev ),我进行了一些测试,最终转到了最后一个版本,但控制台不断向我打印以下输出AssertionError [ERR_ASSERTION]: Task function must be specified我已经尝试了几项操作,例如更改分支,删除node_modules并安装了不同的node_modules版本(例如node_modules @ 3),但没有任何效果

$ 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

Wanna share my silly mistake ^^ 想分享我的愚蠢错误^^

After a couple of tries it seemed like the changes I did were saved in the package-lock.json and I forgot to delete that file as well when getting the environment in a "clean state" 经过几次尝试,似乎我所做的更改已保存在package-lock.json ,并且当环境处于“干净状态”时,我也忘记了删除该文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM