Fadil Mamedov
Fadil Mamedov

Reputation: 184

Gulp always runs "default" task

I have a simple gulpfile.js file with the next content:

var gulp = require("gulp");

gulp.task("test", []);
gulp.task("default", []);

But when I try to run "test" task with command gulp test it always runs only the "default" task. If I remove the "default" task it says Task default is not in your gulpfile

How can I run my custom task from the console?

Upvotes: 3

Views: 1647

Answers (1)

Fadil Mamedov
Fadil Mamedov

Reputation: 184

Ok, I have realized what was the problem. Windows command line doesn't see additional command line arguments, which I passed to the gulp. To resolve this problem we need to go to the registry and fix HKEY_CLASSES_ROOT\Applications\node.exe\shell\open\command key.

Originally the value was C:\Program Files (x86)\nodejs\node.exe" "%1". We need to add the %* symbols to the end of the string. Thus, our key value should look like this:

"C:\Program Files (x86)\nodejs\node.exe" "%1" %*

Upvotes: 1

Related Questions