javascriptnode.jsgulpgulp-watchgulp-sass

Failure to run the Gulp task runner and error while running Gulp Command


I inside the folder where the project is located through the command:

npm i gulp gulp-sass sass --save-dev

I have installed Gulp, but when I want to run it with this command in vs.code terminal :

gulp

I get an error, I wanted to know what caused the error? On the system node js 14.1.0 & 16.13.0 and npm are already installed

enter image description here

enter image description here


Solution

  • The error message hints that gulp is not recognized as a command, I don't think this has anything to do with gulp-sass or sass specifically.

    Option 1

    Install gulp-cli globally:

    npm i -g gulp-cli
    

    glup-cli provides the executable gulp command, which will use the version of gulp is installed in your package. This is the preferred way to run gulp.

    Option 2

    Run gulp directly from your node_modules/.bin folder with the npx command. npx is set up by npm, so there is no need to install any additional packages.

    npx gulp
    

    or, equivalently

    npm exec gulp