错误记录之:

Error: Command failed: C:windowssystem32cmd.exe /s /c "./configure --disable-shared

  1. 错误关键词:cwebp-bin, autoreconf -ivf, pngquant, libpng-dev
  2. 完整的错误信息有3条:
  • Error: Command failed: C:windowssystem32cmd.exe /s /c "./configure --disable-shared --prefix="D:Projectvue-admin-beautiful-templatenode_modulescwebp-binvendor" --bindir="D:Projectvue-admin-beautiful-templatenode_modulescwebp-binvendor""
  • Error: Command failed: C:windowssystem32cmd.exe /s /c "autoreconf -ivf"
    'autoreconf'
  • Error: Command failed: C:windowssystem32cmd.exe /s /c "./configure --with-system-zlib --prefix="D:Projectvue-admin-beautiful-templatenode_modulesoptipng-binvendor" --bindir="D:Projectvue-admin-beautiful-templatenode_modulesoptipng-binvendor""
  • Error: pngquant failed to build, make sure that libpng-dev is installed
  1. 发生场景:安装vue-admin-beautiful项目时遇到的 cnpm i, npm install也试过,甚至fanqiang的方法都试过,还是报错

定位问题

仔细看错误记录会发现有一个提示,不过他是黄色的警告,并不会让人注意,我把完整的记录贴出来:

> cwebp-bin@5.1.0 postinstall D:Projectvue-admin-beautiful-templatenode_modulescwebp-bin
> node lib/install.js

  ‼ getaddrinfo ENOENT raw.githubusercontent.com
  ‼ cwebp pre-build test failed
  i compiling from source
  × Error: Command failed: C:windowssystem32cmd.exe /s /c "./configure --disable-shared --prefix="D:Projectvue-admin-beautiful-templatenode_modulescwebp-binvendor" --bindir="D:Projectvue-admin-beautiful-templatenode_modulescwebp-binvendor""
'.' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���


    at D:Projectvue-admin-beautiful-templatenode_modulesbin-buildnode_modulesexecaindex.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)

> gifsicle@5.1.0 postinstall D:Projectvue-admin-beautiful-templatenode_modulesgifsicle
> node lib/install.js

  ‼ getaddrinfo ENOENT raw.githubusercontent.com
  ‼ gifsicle pre-build test failed
  i compiling from source
  × Error: Command failed: C:windowssystem32cmd.exe /s /c "autoreconf -ivf"
'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

仔细瞧就发现了关键字raw.githubusercontent.com,都是在连接这个地址的时候出现了问题,以前就被这个地址坑过,因为这个地址被墙了很久了,

解决办法

找到问题所在,解决起来就容易得多了,直接找到可用的ip地址写进host里面,这里刚好有一个,如果下面的ip地址不行,找到可用ip地址就好

199.232.28.133  raw.githubusercontent.com

觉得有用 ?喜欢就收藏,顺便点个赞吧,你的支持是我最大的鼓励!微信搜公众号 [DX前端框架知识库],发现更多Vue, React, Flutter, Uniapp, Nodejs, Html/Css等前端知识和实战.

DX前端,分享前端框架知识库,文章详见:DX前端

关注DX前端

内容来源于网络如有侵权请私信删除

文章来源: 博客园

原文链接: https://www.cnblogs.com/quweixiong/p/14308001.html

你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!