Gulp with Laravel Elixir throws events.js:141 unhandled 'error' event
Asked Answered
U

1

7

Since yesterday, gulp throws unhandled error event:

"C:\Program Files (x86)\JetBrains\PhpStorm 10.0.1\bin\runnerw.exe" "C:\Program >Files\nodejs\node.exe" C:\..\..\..\..\..\node_modules\gulp\bin\gulp.js --color -->gulpfile "d:\..\..\..\gulpfile.js" default
[11:41:02] Using gulpfile d:\..\..\..\gulpfile.js
[11:41:02] Starting 'default'...
[11:41:02] Starting 'sass'...

Fetching Sass Source Files...
   - resources\assets\sass\app.scss


Saving To...
   - public\css\app.css

[11:41:02] Finished 'default' after 323 ms
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: no writecb in Transform class
    at afterTransform (d:\..\..\..\node_modules\gulp-autoprefixer\node_modules\readable->stream\lib\_stream_transform.js:95:33)
    at Immediate.TransformState.afterTransform (d:\..\..\..\node_modules\gulp->autoprefixer\node_modules\readable-stream\lib\_stream_transform.js:79:12)
    at Immediate.immediate._onImmediate (timers.js:435:18)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

I already deleted all my node_modules and installed them back again with no luck.

Anyone else having this problem?

Versions:

  • Laravel Framework version 5.1.24 (LTS)
  • Node: 4.2.2
  • npm: 3.5.1
  • gulp: 3.90
Unimpeachable answered 27/11, 2015 at 11:2 Comment(1)
Seems it was an gulp-autoprefixer issue. Perhaps this happens due to version of a package or node itself. Maybe you need some downgrade of gulp-autoprefixer package or smth like this.Kadiyevka
D
8

Seeing you're using 'Laravel' I can only assume you're using 'laravel-elixir'. Due to recent changes in this package there are some compatibility problems with SASS.

You can always use a fixed version in your package.json file and set it to

  "dependencies": {
    "laravel-elixir": "3.4.2",
  }

instead of the default ^3.0.0, witch will auto update to the latest version. After changing the version just re-run npm update

I hope this helps you.

Dreadful answered 27/11, 2015 at 14:8 Comment(2)
Yes, this fixed it! Apparently laravel-elixir was updated to version 3.4.3 which caused this error. Thanks!Unimpeachable
actually the current laravel-elixir version is at 4.0.4 which is a stable release , you SHOULD try updating your npm version with npm install npm@latest -g and your node version check on [nodejs.org/en/download/package-manager/] for your OS version install and update , also update global gulp with npm install gulp@latest -g , this should resolve your issuesPickax

© 2022 - 2024 — McMap. All rights reserved.