imagemin-webpack-plugin icon indicating copy to clipboard operation
imagemin-webpack-plugin copied to clipboard

build error when i use imagemin-webpack-plugin? i dont know how to resolve

Open plane-hjh opened this issue 6 years ago • 5 comments
trafficstars

image

plane-hjh avatar Jul 03 '19 02:07 plane-hjh

Are you sure it's from this plugin? I don't see anything in your image that points to an error in this plugin, but I'm more than happy to help you resolve it!

What version of webpack are you using, and are you willing to share your webpack config with me to take a look?

From looking at it, it looks like cross-spawn is throwing enoent errors, which means a file can't be found. So it could be permissions issues on your system.

Klathmon avatar Jul 03 '19 14:07 Klathmon

image sorry,I only saw the information。my node version is v10.16.0,and npm version is 6.9.0。and the imagemin-webpack-plugin version is 2.4.2。

plane-hjh avatar Aug 30 '19 02:08 plane-hjh

image this is my webpack config,i dont know what wrong

plane-hjh avatar Aug 30 '19 02:08 plane-hjh

Same error here - notFoundError for file cross-spawn/lib/enoent.js

` Error: The system cannot find the path specified.

at notFoundError (C:\Users\XXXXXX\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\Users\XXXXXX\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\Users\XXXXXX\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)

`

Seemed to have pinned it down to this file being missing: \node_modules\optipng-bin\vendor\optipng.exe

Looks like it's the imagemin-optipng dependancy.

Removing it from my webpack config got rid of the error.

edwardpayton avatar Oct 08 '19 15:10 edwardpayton

same as @edwardpayton ,where did these file go?

happy-func avatar Oct 15 '21 11:10 happy-func