error in ./src/views/login/index.vue?vue&type=style&index=0&id=a5aea806&lang=scss&sc
oped=true&
Error: 'D:\AppCode\lingkang-admin-web\node_modules\pngquant-bin\vendor\pngquant.exe'
�����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���
at runMicrotasks (<anonymous>)
@ ./src/views/login/index.vue?vue&type=style&index=0&id=a5aea806&lang=scss&scoped=tru
e& 1:0-548 1:0-548
@ ./src/views/login/index.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi ./src/main.js
ERROR Build failed with errors.
解决方法:
这个错误消息似乎是与图片压缩工具 `pngquant` 相关的问题。错误信息中的内容可能是乱码,但问题的核心是指出了一个与 `pngquant` 相关的可执行文件无法执行。
要解决这个问题,你可以尝试以下步骤:
1. 检查 `pngquant-bin` 版本:首先,检查你的项目的 `package.json` 文件或 `package-lock.json` 文件,查看 `pngquant-bin` 的版本。确保它是最新的版本。你可以使用以下命令来安装最新版本:
```
npm install pngquant-bin@latest --save-dev
```
或者,如果你使用 Yarn 包管理器:
```
yarn add pngquant-bin@latest --dev
```
2. 清除缓存并重新安装依赖项:有时候,缓存可能导致问题。尝试清除 npm 缓存并重新安装依赖项:
```
npm cache clean --force
rm -rf node_modules
npm install
```
或者,如果你使用 Yarn:
```
yarn cache clean
rm -rf node_modules
yarn install
```
3. 检查系统环境:如果上述步骤没有解决问题,确保你的操作系统环境中没有与 `pngquant` 相关的问题。有时候,一些操作系统限制或环境问题可能会影响 `pngquant` 的执行。确保你的操作系统和依赖项都是最新的。
4. 尝试替代工具:如果问题仍然存在,你可以考虑使用其他的图片压缩工具代替 `pngquant`。例如,你可以尝试安装 `imagemin` 等其他工具来压缩图片。在这种情况下,你需要相应地更新你的构建配置以使用新的工具。
通过执行上述步骤中的一个或多个,你有望解决与 `pngquant` 相关的构建问题。确保在解决问题之前备份项目以防止数据丢失。
npm install pngquant-bin@latest --save-dev
npm ERR! code 1
npm ERR! path D:\AppCode\lingkang-admin-web\node_modules\pngquant-bin
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node lib/install.js
npm ERR! compiling from source
npm ERR! getaddrinfo ENOENT raw.githubusercontent.com
npm ERR! pngquant pre-build test failed
npm ERR! Error: Command failed: C:\Windows\system32\cmd.exe /s /c "rm ./INSTALL"
npm ERR! 'rm' �����ڲ����ⲿ���Ҳ���ǿ����еij���
npm ERR! ���������ļ���
npm ERR!
npm ERR!
npm ERR! at D:\AppCode\lingkang-admin-web\node_modules\bin-build\node_modules\exec
a\index.js:231:11
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR! at async Promise.all (index 0)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2023-09-05T05_38_08_
920Z-debug-0.log
解决方法:pngquant-bin 不要安装最新版本,有冲突。
1、npm i pngquant-bin@6.0.1 --save-dev --save-dev保存在package.json里
2、到https://pngquant.org/ 下载win二进制文件,放到\node_modules\pngquant-bin\vendor\,这样在npm run build
我的admin pro 还需要安装optipng-bin 用于Png优化 安装方法和pngquant一样。
npm i optipng-bin@7.0.1 --save-dev
下载OptiPNG Home Page (sourceforge.net)
将optipng.exe放到 \node_modules\optipng-bin\vendor\
完美源码 » vue \node_modules\pngquant-bin\vendor\pngquant.exe