tcoopman / image-webpack-loader

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

Module build failed: Error: spawn Unknown system error -8 . --> dockerizing app #129

Open ilianamarcano opened 6 years ago

ilianamarcano commented 6 years ago

Hello, I have this error

Module build failed: Error: spawn Unknown system error -8
        at _errnoException (util.js:1024:11)
        at ChildProcess.spawn (internal/child_process.js:323:11)
        at Object.exports.spawn (child_process.js:502:9)
        at module.exports (/app/node_modules/execa/index.js:139:26)
        at fsP.writeFile.then (/app/node_modules/exec-buffer/index.js:35:15)

dockerizing with this configuration:


  {
    test: /\.png$/i,
    exclude: /node_modules/,
    use: [
      {
        loader: 'file-loader',
        options: {
          name: '[name].[ext]?[sha512:hash:base64:7]',
        },
      },
      {
        loader: 'image-webpack-loader',
        query: {
          mozjpeg: {
            progressive: true,
          },
          gifsicle: {
            interlaced: false,
          },
          optipng: {
            optimizationLevel: 7,
          },
          pngquant: {
            quality: '0-30',
            speed: 10,
          },
        },
      },
    ],
  },

In my local machine works perfect!!

karel1980 commented 3 years ago

Pretty outdated, but if anyone else stumbles on this by googling for similar errors; Make sure you are not copying node_modules from your host to the docker container in your Dockerfile.