How To Install Gulp with Npm – POFTUT

How To Install Gulp with Npm

Gulp is a streaming build system mainly used by Javascript, Typescript application developers. We may need to install gulp from npm .

Install NPM

In order to install gulp we will install Nodejs Package Manager. Following tutorial explains it in detail.

Install Gulp with Npm

The best and practical way to install Gulp is to install with npm. We will use Nodejs Package Manager or Npm. We will use npm install command with --global and gulp-cli options. Installing globally will requires root privileges.

$ npm install --global gulp-cli
Install Gulp with Npm
Install Gulp with Npm

Install Gulp In Specific Project Dependency

another installation method is installing gulp in a project scope. This will not require any privilege because we will not change any system related directory. We will provide --save-dev options for this.

$ npm install gulp --save-dev

Test Gulp

We can test installation of Gulp by creating a test file named gulpfile.js and put following content.

var gulp = require('gulp'); 
gulp.task('default', function() { 
  // place code for your default task here 

and then run gulp command in the current working directory.

$ gulp
Test Gulp
Test Gulp

We can see from output that Gulp is installed successfully

LEARN MORE  How To Install Nodejs Into Linux (Ubuntu, Debian, Fedora, CentOS, RedHat)?

Leave a Comment