gulp decided it had enough and it died in my project.
current version
gulp -v
[11:26:35] CLI version 3.9.1
[11:26:35] Local version 4.0.0
if i run one of the tasks that worked yesterday I get the following error:
C:\Program Files\nodejs\node_modules\gulp\bin\gulp.js:129 gulpInst.start.apply(gulpInst, toRun); ^
TypeError: Cannot read property 'apply' of undefined at C:\Program Files\nodejs\node_modules\gulp\bin\gulp.js:129:20 at process._tickCallback (internal/process/next_tick.js:61:11) at Function.Module.runMain (internal/modules/cjs/loader.js:745:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
now I have seen this error all over the place and tried many things to fix it
- clear node_module and install with rm -rf node_modules and npm i
- uninstall gulp and gulp-cli from both the global and local packages
- after which I only installed gulp-cli globally and gulp v4 locally in dev
- close everything and restart computer hoping for a magic fix, no luck
EDIT:
also tried the following with no success
- delete package-lock.json to force recreate
- install gulp globally
what does work
There seems to be some issue where the cli version is not being used properly. If i explicitly use the gulp file from my projects local node_modules folder like this:
node ./node_modules/gulp/bin/gulp.js my-task
then the my-task will run and work correctly
what does NOT work
if i use the following command:
gulp my-task
I get the error quoted at the top of this post.
I am not sure where to go from here, I have a workaround but can not figure out why gulp is dying on me when I am trying to use the latest stable version of both gulp and the cli.