今天在构建prettier遇到错误,为了排查问题,在cmd执行npm i -g gifsicle,发生报错: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c “autoreconf -ivf”
问题分析:
错误信息:
npm ERR! compiling from source
npm ERR! connect ETIMEDOUT 127.8.0.1:443
npm ERR! gifsicle pre-build test failed
npm ERR! Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf"
应该是需要安装autoreconf。网上查阅了很多方法,比如使用 Chocolatey 或 Scoop 来安装,步骤复杂不说,最后还两种都以失败告知。
解决办法:
最简单快捷的方法,直接找到autoreconf的windows安装包
https://gnuwin32.sourceforge.net/packages/autoconf.htm
直接下载这个,这里附上地址:
下载安装后,即可解决问题。