解决 raw.githubusercontent.com

##示例:错误
在这里插入图片描述
错误信息代码:

npm WARN deprecated uuid@3.4.0: 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 cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\jpegtran-bin',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\jpegtran-bin'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\jpegtran-bin'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\optipng-bin',
npm WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\optipng-bin'] {
npm WARN cleanup       errno: -4082,
npm WARN cleanup       code: 'EBUSY',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\optipng-bin'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\bin-version',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\bin-version\node_modules\cross-spawn'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\bin-version\\node_modules\\cross-spawn'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\bl\\node_modules\\readable-stream',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\bl\node_modules\readable-stream\lib'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'D:\\nodejs\\vue谷粒外卖\\webpack源码\\webpack_code\\node_modules\\bl\\node_modules\\readable-stream\\lib'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\gifsicle
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node lib/install.js
npm ERR! compiling from source
npm ERR! getaddrinfo ENOENT raw.githubusercontent.com
npm ERR! gifsicle pre-build test failed
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 D:\nodejs\vue谷粒外卖\webpack源码\webpack_code\node_modules\bin-build\node_modules\execa\index.js:231:11
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95: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\42224\AppData\Local\npm-cache\_logs\2024-05-19T11_51_58_984Z-debug-0.log  

##解决方法
通过域名解析网站解析出ip地址
我用下面这个域名

https://site.ip138.com/raw.githubusercontent.com/

在这里插入图片描述
把解析得到的IP地址,选其中一个
将下面的地址写在本地电脑的
C:\Windows\System32\drivers\etc 下的 hosts文件里

185.199.111.133  raw.githubusercontent.com

在这里插入图片描述

保存之后,重新npm,下面是我自己遇到npm下载的问题的代码,解决后重新npm。

npm install imagemin-gifsicle imagemin-jpegtran imagemin-optipng imagemin-svgo -D
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值