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?
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" %*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With