TypeError: gulp.hasTask is not a function
Error 1
$ gulp
[12:01:26] Using gulpfile ~/kraken-server/gulpfile.js
[12:01:26] Starting 'default'...
[12:01:26] 'default' errored after 2.03 ms
[12:01:26] TypeError: gulp.hasTask is not a function
at /home/frank/kraken-server/node_modules/run-sequence/index.js:19:22
at Array.forEach (<anonymous>)
at verifyTaskSets (/home/frank/kraken-server/node_modules/run-sequence/index.js:13:11)
at /home/frank/kraken-server/node_modules/run-sequence/index.js:32:4
at Array.forEach (<anonymous>)
at verifyTaskSets (/home/frank/kraken-server/node_modules/run-sequence/index.js:13:11)
at runSequence (/home/frank/kraken-server/node_modules/run-sequence/index.js:92:2)
at gulp.task (/home/frank/kraken-server/gulpfile.js:43:3)
at taskWrapper (/home/frank/kraken-server/node_modules/undertaker/lib/set-task.js:13:15)
at bound (domain.js:301:14)
Solution
This is due to the wrong gulp version. You are probably using 4+ and need 2 or 3.
$ npm install -g gulp@3.9.1 gulp-cli@1.4.0
If you had some installed locally, also override :
$ npm install gulp@3.9.1 gulp-cli@1.4.0
Error 2
$ gulp
[11:35:56] Using gulpfile ~/kraken-server/gulpfile.js
TypeError: Cannot read property 'apply' of undefined
at /home/frank/.nvm/versions/node/v8.11.2/lib/node_modules/gulp/bin/gulp.js:129:20
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
Solution
This is due to the wrong gulp-cli version.
$npm install -g gulp-cli@1.4.0
$npm install gulp-cli@1.4.0
Recent Comments