Gulp failed with AssertionError
Using the current package.json dependency setting "gulp": ">=3.9.0",version 4.0.0 of gulp-cli is automatically installed.
Setting should be set such that only the version 3 of gulp-cli is installed instead.
Error obtained with gulp v4:
yarn build v0.24.6
$ gulp
assert.js:42
throw new errors.AssertionError({
^
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (/Users/ericluwj/Projects/neb.js/node_modules/undertaker/lib/set-task.js:10:3)
at Gulp.task (/Users/ericluwj/Projects/neb.js/node_modules/undertaker/lib/task.js:13:8)
at Object.<anonymous> (/Users/ericluwj/Projects/neb.js/gulpfile.js:71: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)
at execute (/Users/ericluwj/Projects/neb.js/node_modules/gulp-cli/lib/versioned/^4.0.0/index.js:36:18)
at Liftoff.handleArguments (/Users/ericluwj/Projects/neb.js/node_modules/gulp-cli/index.js:175:63)
at Liftoff.execute (/Users/ericluwj/Projects/neb.js/node_modules/liftoff/index.js:203:12)
at module.exports (/Users/ericluwj/Projects/neb.js/node_modules/flagged-respawn/index.js:51:3)
at Liftoff.<anonymous> (/Users/ericluwj/Projects/neb.js/node_modules/liftoff/index.js:195:5)
at /Users/ericluwj/Projects/neb.js/node_modules/liftoff/index.js:165:9
error Command failed with exit code 1.
Hi, I have this problem, too. Do you resolved it? Thanks. @ericluwj
Try ./node_modules/.bin/gulp instead.
Maybe we should use gulp V3 instead of V4. Thank you. @ericluwj
I had the same problem and resolved it as follows As per the instructions in readme doc, ran the command "npm install gulp -g" as mentioned in step 2 when i was trying to host marbles locally. This gave me the same error as discussed above.
-
To fix it, I removed the gulp completely from global and local directory by using the commands below. Ran both these commands to make sure gulp is removed locally and globally. npm rm gulp -g --save npm rm gulp --save (probably this is not needed, but i did it)
-
Installed gulp using following npm install [email protected] -g --save npm install [email protected] --save (probably this is not needed, but i did it)
After step 3, make sure you have both CLI and Local version as 3.9.1. If Local version is higher, then also I had the problem. I hope this helps.
I had the same problem and resolved it as follows As per the instructions in readme doc, ran the command "npm install gulp -g" as mentioned in step 2 when i was trying to host marbles locally. This gave me the same error as discussed above.
- To fix it, I removed the gulp completely from global and local directory by using the commands below. Ran both these commands to make sure gulp is removed locally and globally. npm rm gulp -g --save npm rm gulp --save (probably this is not needed, but i did it)
- Installed gulp using following npm install [email protected] -g --save npm install [email protected] --save (probably this is not needed, but i did it)
After step 3, make sure you have both CLI and Local version as 3.9.1. If Local version is higher, then also I had the problem. I hope this helps.
yes last both installation are needed, thank you!
Thank you so much man, this solved my issue
yaaayyy!!! it had to be exactly this steps
v3 is deprecated. Here you are using the latest version but older code. With v4, replace gulp.watch('./sass/.sass', ['sass']) with gulp.watch('./sass/.sass', gulp.series('sass')).