tcoopman / image-webpack-loader

Image loader module for webpack
MIT License
2.03k stars 132 forks source link

`yarn` installation doesn't work :( #54

Closed sylar closed 7 years ago

sylar commented 8 years ago

Hello :)

I am using this awesome loader but there seems to be a problem if installed with yarn. Out of the blue i get this error when building for production (basically if i use it)

ERROR in ./[...]/image.png
Module build failed: Error: spawn [...]/project-name/node_modules/pngquant-bin/vendor/pngquant ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

If i install the dependencies with npm, everything works as intended. What am I doing wrong?

Thank you!

LE:

i'm using webpack2 though

this happens only with yarn 0.17 version 0.16.1 works as intended :)

this is from the config

{
        test: /.*\.(gif|png|jpe?g|svg)$/i,
        use: [
          {
            loader: 'file-loader',
            options: {
              name: '[path][hash].[ext]'

            }
          },
          {
            loader: 'image-webpack-loader',
            options: {
              progressive: true,
              optimizationLevel: 7,
              interlaced: false,
              pngquant: {
                quality: '65-90',
                speed: 4
              }
            }
          }
luandro commented 8 years ago

Having the same problem.

tcoopman commented 8 years ago

are you able to install imagemin-pngquant with yarn?

adamsiwiec commented 7 years ago

+1 Extremely annoying!

sylar commented 7 years ago

@tcoopman shouldn't it install it automatically? if it's not for pngs, it's for jpgs :(

tcoopman commented 7 years ago

@andreiconstantinescu yeah, it should. But I have only tested with npm and don't have the time at the moment to check with yarn.

So I would love to know if it works or not if you install imagemin-pngquant manually. If not, it looks like it's something you should check out with imagemin-pngquant.

I also saw that yarn 0.18 is released, so if you can check with the latest version, that would help.

tcoopman commented 7 years ago

I've tested with yarn 0.18.1 and this seems to work fine. Please reopen if you have other experiences.

adrienharnay commented 7 years ago

Hi,

Currently having exactly the same problem on Circle-ci (Alpine linux setup), with Yarn 0.24.6.

robmccardle commented 7 years ago

Experienced this on Debian when inside Docker. Ditching yarn and switching to npm solved it for me.