栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Gulp项目问题 | GitHub插件下载失败Error: Command failed: C:WINDOWSsystem32cmd.exe /s /c “autoreconf -ivf“

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Gulp项目问题 | GitHub插件下载失败Error: Command failed: C:WINDOWSsystem32cmd.exe /s /c “autoreconf -ivf“

  1. 问题
    E:gulp Projecthello-gulp>npm install --save-dev gulp-jshint jshint
    
    > gifsicle@5.2.1 postinstall E:gulp Projecthello-gulpnode_modulesgifsicle
    > node lib/install.js
    
    getaddrinfo ENOENT raw.githubusercontent.com
    gifsicle pre-build test failed
    compiling from source
    Error: Command failed: C:WINDOWSsystem32cmd.exe /s /c "autoreconf -ivf"
    'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    �����������
    
    
        at E:gulp Projecthello-gulpnode_modulesbin-buildnode_modulesexecaindex.js:231:11
        at runMicrotasks ()
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async Promise.all (index 0)
    
    > mozjpeg@7.1.1 postinstall E:gulp Projecthello-gulpnode_modulesmozjpeg
    > node lib/install.js
    
    getaddrinfo ENOENT raw.githubusercontent.com
    mozjpeg pre-build test failed
    compiling from source
    Error: Command failed: C:WINDOWSsystem32cmd.exe /s /c "autoreconf -fiv"
    'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
    �����������
    
    
        at E:gulp Projecthello-gulpnode_modulesbin-buildnode_modulesexecaindex.js:231:11
        at runMicrotasks ()
        at processTicksAndRejections (internal/process/task_queues.js:93:5)
        at async Promise.all (index 0)
    npm WARN hello-gulp@1.0.0 No description
    npm WARN hello-gulp@1.0.0 No repository field.
    npm WARN optional SKIPPING OPTIonAL DEPENDENCY: fsevents@1.2.13 (node_modulesfsevents):
    npm WARN notsup SKIPPING OPTIonAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm WARN optional SKIPPING OPTIonAL DEPENDENCY: gifsicle@5.2.1 (node_modulesgifsicle):
    npm WARN optional SKIPPING OPTIonAL DEPENDENCY: gifsicle@5.2.1 postinstall: `node lib/install.js`
    npm WARN optional SKIPPING OPTIonAL DEPENDENCY: Exit status 1
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! mozjpeg@7.1.1 postinstall: `node lib/install.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the mozjpeg@7.1.1 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     H:nodejsnode_modulesnode_cache_logs2021-11-06T08_52_44_302Z-debug.log
  2. 原因
    由于安装这些包时需要安装依赖包,而其中部分依赖包需要从GitHub上下载,而GitHub的资源库DNS有问题,导致这些依赖包无法安装而报错。
     
  3. 解决
    在本地hosts文件中(路径C:WindowsSystem32driversetc)添加以下内容(Github相关域名的解析地址),然后用npm清楚所有缓存(清除命令为:>npm cache clean -f),之后再重新安装就成功了。
    192.30.255.112	gist.github.com
    192.30.255.112	github.com
    192.30.255.112	www.github.com
    151.101.56.133	avatars0.githubusercontent.com
    151.101.56.133	avatars1.githubusercontent.com
    151.101.56.133	avatars2.githubusercontent.com
    151.101.56.133	avatars3.githubusercontent.com
    151.101.56.133	avatars4.githubusercontent.com
    151.101.56.133	avatars5.githubusercontent.com
    151.101.56.133	avatars6.githubusercontent.com
    151.101.56.133	avatars7.githubusercontent.com
    151.101.56.133	avatars8.githubusercontent.com
    151.101.56.133	camo.githubusercontent.com
    151.101.56.133	cloud.githubusercontent.com
    151.101.56.133	gist.githubusercontent.com
    151.101.56.133	marketplace-screenshots.githubusercontent.com
    151.101.56.133	raw.githubusercontent.com
    151.101.56.133	repository-images.githubusercontent.com
    151.101.56.133	user-images.githubusercontent.com

    如果修改后再次重装还是报错,可以在github.com搜索最新的hosts文件;

    更改hosts文件后刷新本地DNS

    ipconfig /flushdns
  4. npm清除所有缓存

    npm cache clean -f
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/451186.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号