##示例:错误
错误信息代码:
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