Roots Discourse

Yarn build:production asset optimizationError: spawn

Using Sage9.

 94% asset optimizationError: spawn /Users/xxxx/Sites/+trellis/xxxx.co.uk/site/web/app/themes/xxxx/node_modules/jpegtran-bin/vendor/jpegtran ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.

I am assuming this is an issue with my images. I only have x2 images in my /resources/assets/images folder:

  • One is used in my scss: background-image: url('../images/hero.jpg');
  • The other is added within a page in admin: <img src="/app/themes/xxxx/dist/images/xxxx.jpg">

Anyone have any ideas what is causing this or where I should start looking?

Many thanks!

I had a similar issue and was able to fix it by upgrading to the latest imagemin-mozjpeg package.

2 Likes

Thanks @strarsis, this worked for me.
Well, to be exact, rm -rf node_modules and running yarn again did :sweat_smile: