首页 > 其他分享 >解决npm install各种报错的6种方案 Error: Command failed: cmd.exe autoreconf -ivf以及gifsicle pre-build test fail

解决npm install各种报错的6种方案 Error: Command failed: cmd.exe autoreconf -ivf以及gifsicle pre-build test fail

时间:2023-04-24 23:55:38浏览次数:41  
标签:npm githubusercontent deprecated failed 报错 108.133 185.199 com

报错示例:Error: Command failed: C:\Windows\system32\cmd.exe /s /c "autoreconf -ivf" gifsicle pre-build test failed

PS G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo> npm install
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm WARN deprecated @types/[email protected]: This is a stub types definition. svgo provides its own type definitions, so you do not need this installed.
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm WARN deprecated [email protected]: Use official tween.js package
npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! path G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo\node_modules\imagemin-webpack-plugin\node_modules\gifsicle
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node lib/install.js
npm ERR! ‼ connect ETIMEDOUT 185.199.111.133:443
npm ERR!   ‼ gifsicle pre-build test failed
npm ERR!   i compiling from source
npm ERR!   × Error: Command failed: C:\Windows\system32\cmd.exe /s /c "autoreconf -ivf"
npm ERR! 'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
npm ERR! ���������ļ���
npm ERR!
npm ERR!
npm ERR!     at G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo\node_modules\bin-build\node_modules\execa\index.js:231:11
npm ERR!     at runMicrotasks (<anonymous>)
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-04-24T09_19_00_423Z-debug-0.log
PS G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>

问题解决

方案零:刷新刷新 DNS 解析缓存 还有 可以尝试重启电脑

G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>ipconfig /flushdns

Windows IP 配置

已成功刷新 DNS 解析缓存。


方案一:使用yarn

G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>npx yarn install
yarn install v1.22.19
warning package.json: No license field
info No lockfile found.
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning [email protected]: No license field
[1/4] Resolving packages...
warning [email protected]: Use official tween.js package
⠈ yallist@^4.0.0

方案二:使用cnpm

npx cnpm install

方案三:修改配置host

  • ping一下 raw.githubusercontent.com

  • 查询 raw.githubusercontent.com 这个所对应的IP,如下面的例子

  • 打开本地C:\Windows\System32\drivers\etc\hosts文件

  • 添加


185.199.108.133    raw.githubusercontent.com
185.199.108.133    gist.githubusercontent.com
185.199.108.133    cloud.githubusercontent.com
185.199.108.133    camo.githubusercontent.com
185.199.108.133    avatars0.githubusercontent.com
185.199.108.133    avatars1.githubusercontent.com
185.199.108.133    avatars2.githubusercontent.com
185.199.108.133    avatars3.githubusercontent.com
185.199.108.133    avatars4.githubusercontent.com
185.199.108.133    avatars5.githubusercontent.com
185.199.108.133    avatars6.githubusercontent.com
185.199.108.133    avatars7.githubusercontent.com
185.199.108.133    avatars8.githubusercontent.com



方案四:这种解决其他报错比较多-修改npm源

npm --registry https://registry.npm.taobao.org install

方案五: 清理缓存

G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>npm cache clean --force
npm WARN using --force Recommended protections disabled.

G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>npm cache verify
Cache verified and compressed (~\AppData\Local\npm-cache\_cacache)
Content verified: 0 (0 bytes)
Index entries: 0
Finished in 0.007s

G:\code_all\my_webpack_webgl2021-5-17-dev_01\three151-demo>

其他报错 Install fail! Error: EBUSY: resource busy or locked

方案零:关机重启,然后再 npm install

方案一:删除package-lock.json 和 node_modules,然后再 npm install

方案二:运行 npm cache clean --force 或者 npm cache verify ,然后再 npm install / cnpm install。

方案二:升级 npm, npm i -g npm,然后npm run dev / cnpm run dev

今天就写到这里啦~

  • 小伙伴们,( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ我们明天再见啦~~
  • 大家要天天开心哦

欢迎大家指出文章需要改正之处~
学无止境,合作共赢

在这里插入图片描述

欢迎路过的小哥哥小姐姐们提出更好的意见哇~~

标签:npm,githubusercontent,deprecated,failed,报错,108.133,185.199,com
From: https://www.cnblogs.com/sugartang/p/17350415.html

相关文章

  • Navicat连接Oracle报错:ORA-28547...
    使用Navicat连接正常的oracle数据库时,提示 可能是因为Navicat本地的OCI版本与Oracle数据库版本不符造成的,可以下载对应的OCI版本在Navicat中使用。1.下载OCI搜索oracleinstantclient找到相关下载地址OracleInstantClientDownloads根据实际oracle数据库版本选择对应in......
  • 解决Some index files failed to download.They have been ignored, or old ones used
    使用pingwww.baidu.com测试一下网络,如果出现:ping:www.baidu.com:Temporaryfailureinnameresolution就是网络问题了以下是解决办法,修改两处后重启即可,下面详细说明第一处修改的地方:sudovim/etc/systemd/resolved.conf修改DNS如下:[Resolve]DNS=8.8.8.8#FallbackD......
  • Python学习笔记--json序列化时间报错-改源码
    问题:转换时间报错执行代码为:importjsonfromdatetimeimportdate,datetimed={"time1":date.today(),"time2":datetime.today()}res=json.dumps(d)#报错  TypeError:ObjectoftypedateisnotJSONserializable方案1:手动转换str()方案2:继承类......
  • 【c&c++】VScode报错error: ‘::main‘ must return ‘int‘ void main()
    在运行指针时终端出现error:‘::main’mustreturn‘int’voidmain()错误。源代码如下:#include<stdio.h>voidmain(){inta,*p,b,c,d,e;a=100;p=&a;/*(*&a)先进行&a运算,得a的地址,再进行*运算,即变量a的值*/b=*&a;printf("a=%d\n",a);......
  • ElementUI: Uncaught (in promise) cancel 报错
    场景:使用element confirm组件时,点击【取消】按钮,提示错误 Uncaught(inpromise)cancel 代码如下:open(){this.$confirm('此操作将永久删除该文件,是否继续?','提示',{confirmButtonText:'确定',cancelButtonText:'取消',......
  • pip 安装库是报错ERROR: Cannot unpack file C:\Users\LX\AppData\Local\Temp\p
    使用pip安装python库的时候出现报错:ERROR:CannotunpackfileC:\Users\LX\AppData\Local\Temp\pip-unpack-apk_4xkw\simple(downloadedfromC:\Users\LX\AppData\Local\Temp\pip-req-build-htbv29co,content-type:text/html;charset=utf-8);cannotdetectarch......
  • vue前端使用nexus配置npm私有仓库
    当我们运行前端项目的时候,常常在解决依赖的时候会加上一个参数npminstall--registry=https://registry.npm.taobao.org将源指定为淘宝的源,以期让速度加快起来,事实上这种的确能够让速度变快,但是长久来看,如果想真正的快速敏捷开发部署,搭建企业内部的私服,则会让速度更上一个台阶。......
  • web前端pdf.js预览pdf实例创建报错:Array. prototype` contains unexpected enumerable
    使用pdf.min.js是预览pdf文件,但是在实例化时异常报错,下面是实例化的代码varloadingTask=window.pdfjsLib.getDocument(url);console.log(loadingTask);this.pageNum=1;this.pageRendering=false;this.pageNumPending=null;loadingTask.promise.then((pdfDoc_)=>......
  • uiautomatorviewer.bat 多种报错问题的解决办法
    问题一:使用Android_sdk--tools里的uiautomatorviewer.bat定位页面元素时报错:Remoteobjectdoesn'texists解决办法:使用uiautomatorviewer.bat时要关闭Appium。因为它们都使用同一个端口来连接模拟器。 问题二:使用uiautomatorviewer.bat定位页面元素时报错:Unexpected......
  • springboot集成redis时总报错Connection refused: no further information: localhost
    nacos上配置的关于redis的key值不是springboot需要的固定写法如:sping.redis.host=spring.redis.port=sping.redis.password=spring.redis.database=我写的是一个自定义的key如com.dream.redis.host改为springboot认识的即可其他和springboot集成的组件类似,切记......