CSS Blog For Everyone

How to install Gulp globally on Windows

Here is a quick guide on how to install Gulp globally on Windows systems. (Much of these instructions will be the same for Macs, but may have slightly different syntax.)

Download and install Node and npm

Node JS homepage

First, you need to have Node and npm (Node Package Manager) installed on your computer.

If you’re not sure if you have Node installed, open your command line and run node -v or node --version. If it is installed it will return the version number that you have, for example v8.17.0.

If you don’t have Node installed, the best way to get it is to go to NodeJS.org and download the installation files for your operating system. Once it’s downloaded, run the program to install Node.

Installing Node will also automatically install npm on your computer at the same time!

Install the Gulp CLI (command line utility)

Gulp comes in two parts: the Gulp CLI (command line utility) that is installed globally on your computer, and then local Gulp packages installed in each individual project you might have.

This separation, introduced in Gulp v4 allows you to run different versions of Gulp in each local project. You can read more about this change on the Gulp team’s Medium article.

Note: If you’re running an old version of Gulp where you’ve installed the gulp package globally, you’ll have to uninstall it before installing the Gulp CLI. Run npm uninstall -g gulp first.

To install the Gulp CLI globally, on your command line, run npm install gulp-cli -g. The -g flag means npm will install the package in the global npm directory, so you can run the gulp command from any directory.

Install Gulp into your local project

Once you have the Gulp CLI globally installed, you can then install it locally in any project directory you need Gulp in.

To install Gulp locally, navigate to your project directory and run npm install gulp. You can save it to your package.json dependencies by running npm install gulp --save-dev.

Once you have Gulp installed locally, you can then proceed to create your gulpfile.js in your project and create your Gulp tasks! Check out my full tutorial on how to set up Gulp for a Sass/SCSS and JS workflow.

Want to learn how to build a website?

I’m making a course that will teach you how to build a real-world responsive website from scratch!

Learn more

Leave a comment