Vue Package Image Error: Syntax Error: Error: ‘**\node_modules\pngquant-bin\vendor\pngquant.exe‘

When packaging, an error is displayed at a picture path
Syntax Error: Error: ‘D:\work\tiny-sample\src\frontend\web\packages\src-entry\node_modules\pngquant-bin\vendor\pngquant.exe’


It can be seen that the package pngquant-bin reports an error, and the package is derived from the dependency of image-webpack-loader, so the root cause is image-webpack-loader.
Solution: delete the dependency image-webpack-loader, and then reinstall it. If it doesn’t work, try a few more times.

npm uninstall image-webpack-loader
npm install image-webpack-loader

If it still fails, set the image for NPM and repeat the above two steps

Read More: