papandreou / node-pngquant

The pngquant utility as a readable/writable stream
BSD 3-Clause "New" or "Revised" License
82 stars 23 forks source link

ReferenceError: require is not defined #104

Closed xsstomy closed 1 year ago

xsstomy commented 1 year ago

image

image

node 16

how can i fix this ?

windows os

thank you

papandreou commented 1 year ago

I have no idea what you're trying to do. Please provide actual reproduction steps.

xsstomy commented 1 year ago

i found that the pngquant binary is not in my PATH.

image

when i use this function ,error above

papandreou commented 1 year ago

@ubermanu seems to understand what the problem is. I've published 4.2.0 with the fix, could you try with that?

xsstomy commented 1 year ago

image

image

new error

@papandreou

ubermanu commented 1 year ago

Somehow i had the same issue, but managed to make it work using a compact quality arg:

new PngQuant([192, "--quality=60-80", "--nofs", "-"])