April 19th, 2019
Installing Gulp for the first time can be tricky, this tutorial will guide you through every step of the installation. The steps below are for the installation of Gulp on a Windows 10 PC. If you have any issues installing Gulp, enter a full description of the issue in the comments section at the bottom of this page.
C:\Program Files\nodejs
PATH
and choose to edit it.PATH
variable is empty, change it to this ( replacing {YOUR USERNAME HERE} with your username for your windows account ): C:\Users\{YOUR USERNAME HERE}\AppData\Roaming\npm;C:\Program Files\nodejs
PATH
variable already contains C:\Users\{YOUR USERNAME HERE}\AppData\Roaming\npm
, append the following right after: ;C:\Program Files\nodejs
C:\Users\{YOUR USERNAME HERE}\AppData\Roaming
You will notice that there is no /npm/ folder, simply create the folder by right clicking and selecting “add new folder” then name it “npm”npm -v
, This should return a version numberA Javascript file is required to run gulp tasks as they will need to be configured.
Create a file named gulpfile.js
in the folder which you would like to use Gulp and add the following:
// Require Gulp into file and define the variable
var gulp = require('gulp');
// Run the example task, if installed correctly and "gulp talktome" is ran, "Hello From Zestcode" should be printed in the logs
gulp.task('talktome', function() {
console.log('Hello From Zestcode');
});
To install Gulp, open the terminal in the same directory you created the gulpfile.js file and run npm i gulp --save-dev
, once it has finished running type gulp talktome
in to the command line. Hello From Zestcode
should appear in the terminal. If it does, congratulations! You have successfully installed NPM & Gulp.
Now you have Gulp running and working in your folder, you can begin to look at installing some custom packages to create some task management functions such as:
You can view all avaliable NPM packages here.