How to install gulp globally in current project?

23

Have you tried running it as with sudo?

sudo npm install --global gulp
sudo npm install -g gulp

The other command is when you try to default gulp file, you should install gulp first.


  • For gulp command version:

If you have previously installed a version of gulp globally, please run

$ npm rm --global gulp

to make sure your old version doesn't collide with gulp-cli.

$ npm install --global gulp-cli

Install gulp in your project devDependencies:

$ npm install --save-dev gulp

Create a gulpfile.js at the root of your project:

var gulp = require('gulp');

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

Run gulp:

$ gulp

If you have problems running gulp, consider nodejs tries to call it from bad location, so you can add:

sudo ln -s /usr/bin/nodejs /usr/bin/node
Share:
23

Related videos on Youtube

salbert21
Author by

salbert21

Updated on September 18, 2022

Comments

  • salbert21
    salbert21 over 1 year

    When I try to use python from either command prompt or windows powershell, I get the error that "Python was not found". This started happening after I recently reinstalled Anaconda, which is how I install and manage python and related packages.

    What's odd is that "conda --version" works fine in command prompt. Also, "python --version" works fine in Anaconda prompt. But, I have added the output of "where python" in the Anaconda prompt to the user variable "Path" under environment variables, along with the outputs of "where conda". I'll note that this is within my user directory, which contains a space in the name, but the same is true for the conda path definition and that seems to work just fine.

    Windows 10 Enterprise, conda 4.10.3, python 3.9.7. Thanks.

  • kyrgyz_jigit
    kyrgyz_jigit about 8 years
    I had solved this . But anyway thanks for response dude
  • prosti
    prosti about 8 years
    no worries. Good question, thought.
  • edwinksl
    edwinksl over 7 years
    @kirgiz_jigit How did you solve your problem?