Gulp Error in WebStorm: Failed to execute Gulp Task List

My WebStorm has stopped working with gulp files.

It worked fine until last Friday.

This message appears in the console:

Failed to display gulp tasks in questionary / gulpfile.js: could not parse JSON β†’ Unterminated array in row 1 column 5 path $ [1] * Edit Parameters

$ / usr / local / bin / node / Users / rkon2006 / Projects / My / questionary / node_modules / gulp / bin / gulp.js --no-color --gulpfile / Users / rkon2006 / Projects / My / questionary / gulpfile. js --tasks-json [17:26:14] Using gulpfile ~ / Projects / My / questionary / gulpfile.js [17:26:14] Running 'default' ... Default task ...

This is the code from my gulpfile.js (it does not even run with this code):

var gulp = require('gulp');

gulp.task('default', function () {
    console.log('Default task...');
});
Run codeHide result

Process terminated by exit code 0

gulp v4.0, node js 4.1.1 ( 0.10.28 4.1.1) npm 2.14.4.

- ?

+4
3

webstorm node. :

Gulp, webstorm , cog Gulp , "Gulp Gulp (Gulp node_modules ).

: \node_modules\gulp

+13

node npm, .

+2

The problem is that some text is written to the standard output when evaluating gulpfile.js, but before running any gulp task (i.e., logging is done outside of gulp tasks); possible workarounds:

  • Avoid entering the standard output stream outside of the gulp task.

or

  • Do not register in the standard output stream if it is started to print a task, for example:
if (!isListingTasks()) {
    console.log('[my info]');
}

function isListingTasks() {
    return process.argv[process.argv.length - 1] === '--tasks-json';
}
+1
source

Source: https://habr.com/ru/post/1609327/


All Articles