Skip to content

Problems with Errors When Deploying the imagemin-pngquant Plugin to Linux #88

@wajjforever1314

Description

@wajjforever1314

Dear author,
I'm a fan of imagemin-pngquant. I've never deployed my project to a Linux system before. However, recently I deployed my Node project to Linux, and this tool encountered an error. But there is no such problem when I use it on my macOS system.
Here is how I use the code:

    const imagemin = (await import('imagemin')).default;
    const imageminPngquant = (await import('imagemin-pngquant')).default;
    const compressedUint8Array = await imagemin.buffer(imageBuffer, {
        plugins: [imageminPngquant({ quality: [0.6, 0.9] })]
    });

And here is the error message on Linux:

Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:159:15)
    at writeGeneric (node:internal/stream_base_commons:150:3)
    at Socket._writeGeneric (node:net:964:11)
    at Socket._write (node:net:976:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)
    at Writable.end (node:internal/streams/writable:823:17)
    at Socket.end (node:net:735:31)
    at handleInput (file:///data/qichao/middleware/node_modules/execa/lib/stream.js:53:17)
    at execa (file:///data/qichao/middleware/node_modules/execa/index.js:162:2)
    at file:///data/qichao/middleware/node_modules/imagemin-pngquant/index.js:61:27
    at file:///data/qichao/middleware/node_modules/p-pipe/index.js:10:25
    at imagemin.buffer (file:///data/qichao/middleware/node_modules/imagemin/index.js:82:47)
    at exports.embeddingWatermark (/data/qichao/middleware/src/services/modelService.js:890:53)
    at async exports.embeddingWatermark (/data/qichao/middleware/src/controllers/modelController.js:252:22) {
errno: -32,
code: 'EPIPE',
syscall: 'write',
originalMessage: 'write EPIPE',
shortMessage: 'Command failed with EPIPE: /data/qichao/middleware/node_modules/pngquant-bin/vendor/pngquant - --quality 60-90\n' +
    'write EPIPE',
command: '/data/qichao/middleware/node_modules/pngquant-bin/vendor/pngquant - --quality 60-90',
escapedCommand: '"/data/qichao/middleware/node_modules/pngquant-bin/vendor/pngquant" - --quality 60-90',
exitCode: undefined,
signal: undefined,
signalDescription: undefined,
stdout: <Buffer >,
stderr: <Buffer 2f 64 61 74 61 2f 71 69 63 68 61 6f 2f 6d 69 64 64 6c 65 77 61 72 65 2f 6e 6f 64 65 5f 6d 6f 64 75 6c 65 73 2f 70 6e 67 71 75 61 6e 74 2d 62 69 6e 2f ...
110 more bytes>,
cwd: '/data/qichao/middleware',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

I sincerely hope you can kindly tell me where the problem lies.
Thank you so so much! I really appreciate it!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions