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

0

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

gulp gulp-sass gulp-watch javascript
2021-11-24 06:15:40
1

1

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
2021-11-24 16:21:23

Thanks for your reply, it was executed with the second option command
Qualima

My question is why, despite the fact that the Node JS and Gulp ( install in local modules folder ) packages are installed, why the ` gulp ` command is not executed ???
Qualima

Well, installing a local package is typically not enough to make a command executable. npm can resolve automatically commands inside the scripts of a package.json file, but to make those commands executable from the console, it takes an additional layer. That is why we have global packages like gulp-cli, @vue/cli, @angular/cli, etc.
GOTO 0

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................