title: How to upgrade to Gulp 4 through some npm script?
body: <p>I am using gulp version 3.9.0. 
  I want to upgrade it to version 4 in order to make use of features like <code>gulp.series</code> etc.</p>
  
  <p>However on executing <code>npm install</code> command I want to make sure whether gulp version is minimum 4.x and if not it should upgrade itself to gulp 4.x but better through some separate .js script file, present in the root folder of my app.</p>
  
  <p>Now I guess because 4.x is not yet official for gulp, so the file should execute the following commands as indicated in Mike Street's Blog (see <a href="https://www.liquidlight.co.uk/blog/article/how-do-i-update-to-gulp-4/" rel="nofollow">link</a>), in order to remove gulp locally.</p>
  
  <pre><code>npm uninstall gulp --save-dev
  npm install 'gulpjs/gulp.git#4.0' --save-dev
  </code></pre>
  
  <p>How can I do that? </p>
  
  <p>Note: The upgrade of gulp should only occur if version of gulp present in node_modules folder is less than 4.x. Please consider me a novice in node/npm.</p>