oyjt/uniapp-vue3-template

windowspnpm很多都不能build...比如gifsicle

Closed this issue · 3 comments

.../gifsicle@5.2.0/node_modules/gifsicle postinstall$ node lib/install.js
│ ‼ getaddrinfo ENOENT raw.githubusercontent.com
│ ‼ gifsicle pre-build test failed
│ i compiling from source
│ × Error: Command failed: C:\windows\system32\cmd.exe /s /c "autoreconf -ivf"
│ 'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
│ ���������ļ���
│ at D:\phpstudy_pro\WWW\uni\uniapp-vue3-template\node_modules.pnpm\execa@0.7.0\node_modules\execa\index.js:231:11
│ at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
│ at async Promise.all (index 0)

│ getaddrinfo ENOENT raw.githubusercontent.com
│ compiling from source
│ pngquant pre-build test failed
│ Error: pngquant failed to build, make sure that libpng-dev is installed
│ at D:\phpstudy_pro\WWW\uni\uniapp-vue3-template\node_modules.pnpm\execa@0.7.0\node_modules\execa\index.js:231:11
│ at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
│ at async Promise.all (index 0)

oyjt commented

vite-plugin-imagemin这个图片压缩插件导致的,如果不用这个插件可以删除后再安装。

这里贴一下vite-plugin-imagemin相关说明

由于 imagemin 在**不好安装。现提供几个解决方案

使用 yarnpackage.json 内配置(推荐)

"resolutions": {
"bin-wrapper": "npm:bin-wrapper-china"
},

使用 npm,在电脑 host 文件加上如下配置即可

199.232.4.133 raw.githubusercontent.com

使用 cnpm 安装(不推荐)

在电脑 host 也不行,几种方法都不行。我觉得就不应该用这个插件,我看几年都没维护了。

pnpm install --ignore-scripts可以解决