1. First you need to install gulp 4 globally

npm rm -g gulp
npm install -g gulp-cli

Check gulp version

gulp -v

You should see this:

CLI version 1.2.1

2. Now you have to install gulp 4 locally in your project folder

cd /your_project_folder
npm uninstall gulp --save-dev
npm install 'gulpjs/gulp.git#4.0' --save-dev

Check gulp version again

gulp -v

And you should see

CLI version 1.2.1
Local version 4.0.0-alpha.2