Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp error in WebStorm: Failed to list gulp tasks

My WebStorm has stopped read and run gulp tasks.

It was working fine until last Friday.

This is an error that appears in console:

Failed to list gulp tasks in questionary/gulpfile.js: Failed to parse JSON -> Unterminated array at line 1 column 5 path $[1] * Edit settings

$ /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] Starting 'default'... Default task...

This is the code from my gulpfile.js (it doesn't start even with this code):

var gulp = require('gulp');

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

Process finished with exit code 0

I use gulp v4.0, node js 4.1.1 (tried defferent versions from 0.10.28 up to 4.1.1) and npm 2.14.4.

Do you have any ideas about this?

like image 528
Роман Кононихин Avatar asked Sep 28 '15 14:09

Роман Кононихин


2 Answers

I have the same problem with webstorm after install a updated version of node. The solution for me is the following:

In the block Gulp where webstorm show the list of task, click the cog icon and select gulp settings, in the section "Gulp package" add the path to the local gulp package(the gulp inside the node_modules in your project).

Example of path: yourproject\node_modules\gulp

like image 136
chalo Avatar answered Sep 20 '22 13:09

chalo


Update node version and npm itself, that did the trick.

like image 30
Gal Margalit Avatar answered Sep 19 '22 13:09

Gal Margalit