Closed mystikodesign closed 7 years ago
node 6.7.0, npm 3.10.3. Same error: `(node:15902) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 9): TypeError: Expected a buffer (node:15902) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 10): TypeError: Expected a buffer
Fatal error: stream.on is not a function`
Same here (node 6.6.0, npm 3.10.3):
(node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Expected a buffer (node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Expected a buffer (node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Expected a buffer (node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Expected a buffer (node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): TypeError: Expected a buffer (node:7589) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: Expected a buffer
If I remove mozjpeg everything is working as expected.
Same issue for me with « imagemin-jpegtran » and with « imagemin » npm package, others (gif, svg and png) work well.
OS Windows 10 ; node 7.1.0 ; npm 3.10.9.
(node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Error in file: C:/nodejs/
Command failed: C:\Users\
(node:8088) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8088) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Error in file: C:/nodejs/
Command failed: C:\Users\
Any progress on this? Is this something related to configuration or a bug? If so is this a grunt-contrib-imagemin bug or one of its dependencies?
I have the same problem! Anybody can fix it???
liuyuan (master ) frontend-nanodegree-mobile-portfolio $ grunt imagemin Running "imagemin:static" (imagemin) task (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 5): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 7): TypeError: Expected a buffer (node:15467) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 8): TypeError: Expected a buffer Fatal error: stream.on is not a function liuyuan (master ) frontend-nanodegree-mobile-p
try to run node with --trace-warnings
I'm having the same problem as soon as I have tried to use another plugin for JPG file. I have tried mozjpeg and jpegoptim. Both produce the same error.
Count me in among those affected. Same error. Rolling back node versions hasn't affected anything (as the original poster noted this happened with the Node 7 update for them).
Same error for me, tried with imageminJpegRecompress().
Switching to optipng instead of using pngquant solved the issue for me. I have no idea of optipng is any better or worse than pngquant but at least the process runs. ¯\(ツ)/¯
Same problem here. Win 10 1703, Node 6.9.5.
Downgrading to "imagemin-mozjpeg": "^5.1.0"
solves the issue (in case you use mozjpeg).
It works for me with an older version of plugin: imagemin-jpeg-recompress@4.3.0.
@tujlaky disabling mozjpeg
did it to me, and then (on Mac OS Sierra) I installed it brew install mozjpeg
and everything went ok. I hope this help somebody.
I had to downgrade imagemin-{jpeg-recompress,pngquant}
to 4.3.0/4.2.2 to get over this issue. Would it be possible to get this fixed/updated so it works with Grunt?
Thanks.
Can you try out 2.0.0
? If the issue still persists I'll reopen.
λ node -v v10.16.0 npm -v 6.9.0 gulp -v [20:49:22] CLI version 3.9.1 [20:49:22] Local version 3.9.1 windows 10 1903 latest lts version same error (node:12860) UnhandledPromiseRejectionWarning: TypeError: Patterns must be a string or an array of strings
Using grunt-contrib-imagemin, was working perfectly until Node 7.0 update.
Now returns an error in terminal, and hangs: (node:24085) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Expected a buffer (node:24085) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:24085) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Expected a buffer (node:24085) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: Expected a buffer (node:24085) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): TypeError: Expected a buffer