heya, back to this topic again. I found this thread which supposedly pushed a fix for this issue, The new toolkit (Sept 2020) is supposed to have a fix that checks for Gulp 3 formatted gulpfile and if not, then use Gulp 4 format. On a new PC dev machine I just installed all the latest and greatest (except Ionic v1), using toolkit 3.2.15 - but I am still having the issue. Hopefully there is any easy fix for it as I am trying to eliminate as many legacy dependencies as possible.
opened 02:40AM - 19 Aug 20 UTC
closed 03:28PM - 08 Sep 20 UTC
triage
**Description:**
When running `ionic cordova build ios`, `ionic cordova build a… ndroid` or `ionic serve`, I get the following error, however the builds complete successfully and the app is able to run locally:
```
Error: Your gulpfile.js is not compatible with Gulp v4:
- Upgrade to gulp v4 (see https://zzz.buzz/2016/11/19/gulp-4-0-upgrade-guide/)
- Or downgrade @ionic/v1-toolkit to <= 3.2.0.
at loadGulp (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:61:19)
at tasks (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:69:28)
at Object.hasTask (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:85:23)
at BuildCommand.run (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/commands/build.js:13:26)
at BaseExecutor.run (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/cli-framework/lib/executor.js:89:23)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
```
The contents of my gulpfile.js have been updated for gulp 4 (See below). If I run gulp commands such as `gulp`, `gulp sass` or `gulp watch`, they run successfully without any error. Are there any issues with my gulp file?
```
var gulp = require('gulp');
var sass = require('gulp-sass');
var cleanCss = require('gulp-clean-css');
var rename = require('gulp-rename');
var paths = {
sass: ['./scss/**/*.scss']
};
gulp.task('sass', gulp.series(function(done) {
gulp.src('./scss/ionic.app.scss')
.pipe(sass())
.on('error', sass.logError)
.pipe(gulp.dest('./www/css/'))
.pipe(cleanCss({
keepSpecialComments: 0
}))
.pipe(rename({ extname: '.min.css' }))
.pipe(gulp.dest('./www/css/'))
.on('end', done);
}));
gulp.task('default', gulp.task('sass'));
gulp.task('watch', gulp.series('sass', function() {
gulp.watch(paths.sass, gulp.task('sass'));
}));
```
I have updated gulp and am using gulp v4.0.2. I noticed that the error that I am receiving above was added to the @ionic-cli/v1-toolkit a few days ago in https://github.com/ionic-team/ionic-cli/pull/4509.
I'm not sure if this PR is related to the issue but wanted to mention it incase it's helpful. The issue may also be related to https://github.com/ionic-team/ionic-cli/issues/4114.
**Steps to Reproduce:**
I receive the error
```
Your gulpfile.js is not compatible with Gulp v4:
- Upgrade to gulp v4 (see https://zzz.buzz/2016/11/19/gulp-4-0-upgrade-guide/)
- Or downgrade @ionic/v1-toolkit to <= 3.2.0.
```
every time I run any of `ionic cordova build ios`, `ionic cordova build android` or `ionic serve`.
**Output:**
An example output from `ionic cordova build ios --verbose` is:
```
ionic:lib Terminal info: { ci: false, shell: '/bin/bash', tty: true, windows: false } +0ms
ionic:lib CLI global options: { _: [ 'cordova', 'build', 'ios' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +4ms
ionic:lib:project Project type from config: Ionic 1 (ionic1) +0ms
ionic:lib:project Project details: { configPath: '/Users/tejogol/Documents/Slide/github/ionic-base/ionic.config.json', errors: [], context: 'app', type: 'ionic1' } +0ms
ionic Context: { binPath: '/Users/tejogol/.nvm/versions/node/v10.18.1/lib/node_modules/@ionic/cli/bin/ionic', libPath: '/Users/tejogol/.nvm/versions/node/v10.18.1/lib/node_modules/@ionic/cli', execPath: '/Users/tejogol/Documents/Slide/github/ionic-base', version: '6.11.0' } +0ms
ionic:lib:integrations:cordova:config Loading Cordova Config (config.xml: '/Users/tejogol/Documents/Slide/github/ionic-base/config.xml', package.json: '/Users/tejogol/Documents/Slide/github/ionic-base/package.json') +0ms
ionic:lib:build build options: { '--': [],
ionic:lib:build engine: 'cordova',
ionic:lib:build platform: 'ios',
ionic:lib:build project: undefined,
ionic:lib:build verbose: false,
ionic:lib:build type: 'ionic1' } +0ms
ionic:lib:telemetry Sending telemetry for command: 'ionic cordova build' [ 'ios', '--verbose', '--interactive', '--color' ] +0ms
ionic:lib:hooks Looking for ionic:build:before npm script. +0ms
ionic:lib:build Looking for ionic:build npm script. +6ms
> ionic-v1 build
ionic:v1-toolkit:lib:gulp Using gulpfile: /Users/tejogol/Documents/Slide/github/ionic-base/gulpfile.js +0ms
ionic:v1-toolkit:lib:gulp Using gulp: /Users/tejogol/Documents/Slide/github/ionic-base/node_modules/gulp/index.js +4ms
[22:20:55] Cannot load gulp tasks: Error: Your gulpfile.js is not compatible with Gulp v4:
- Upgrade to gulp v4 (see https://zzz.buzz/2016/11/19/gulp-4-0-upgrade-guide/)
- Or downgrade @ionic/v1-toolkit to <= 3.2.0.
Error: Your gulpfile.js is not compatible with Gulp v4:
- Upgrade to gulp v4 (see https://zzz.buzz/2016/11/19/gulp-4-0-upgrade-guide/)
- Or downgrade @ionic/v1-toolkit to <= 3.2.0.
at loadGulp (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:61:19)
at tasks (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:69:28)
at Object.hasTask (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/lib/gulp.js:85:23)
at BuildCommand.run (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/v1-toolkit/dist/commands/build.js:13:26)
at BaseExecutor.run (/Users/tejogol/Documents/Slide/github/ionic-base/node_modules/@ionic/cli-framework/lib/executor.js:89:23)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)[22:20:55] Invoking sass gulp task.
ionic:lib:hooks Looking for ionic:build:after npm script. +5s
> cordova build ios --verbose
...
```
**My `ionic info`:**
```
Ionic:
Ionic CLI : 6.11.0 (/Users/tejogol/.nvm/versions/node/v10.18.1/lib/node_modules/@ionic/cli)
Ionic Framework : ionic1 1.3.4
@ionic/v1-toolkit : 3.2.4
Cordova:
Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 8.0.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 2.5.3, (and 10 other plugins)
Utility:
cordova-res : not installed
native-run (update available: 1.0.0) : 0.3.0
System:
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v10.18.1 (/Users/tejogol/.nvm/versions/node/v10.18.1/bin/node)
npm : 6.13.4
OS : macOS Catalina
Xcode : Xcode 11.3.1 Build version 11C504
```