Klathmon / imagemin-webpack-plugin

Plugin to compress images with imagemin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

plane-hjh opened this issue · comments

commented

image

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.

commented

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。

commented

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

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.

same as @edwardpayton ,where did these file go?