CRMEB cwebp pre-build test failed

457 阅读4分钟

使用CRMEB进行二开的时候,经常会遇到执行npm i 安装软件的时候报错,以下我把所有的报错全部都粘贴出来,供大家参考:


> cwebp-bin@7.0.1 postinstall F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\cwebp-bin
> node lib/install.js

connect ETIMEDOUT 182.43.124.6:443
cwebp pre-build test failed
compiling from source
cwebp built successfully
(node:12968) UnhandledPromiseRejectionWarning: Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "./configure --disable-shared --prefix="F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\cwebp-bin\vendor" --bindir="F:\BaiFu
WangCode\nongkou-jd-home-admin\node_modules\cwebp-bin\vendor""
'.' ????????????????????????е????
?????????????
    at F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\bin-build\node_modules\execa\index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:12968) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). T
o terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:12968) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> gifsicle@5.2.1 postinstall F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\gifsicle
> node lib/install.js

connect ETIMEDOUT 182.43.124.6:443
gifsicle pre-build test failed
compiling from source
Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf"
'autoreconf' ????????????????????????е????
?????????????


    at F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\bin-build\node_modules\execa\index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)

> mozjpeg@7.1.1 postinstall F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\mozjpeg
> node lib/install.js

connect ETIMEDOUT 182.43.124.6:443
mozjpeg pre-build test failed
compiling from source
Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -fiv"
'autoreconf' ????????????????????????е????
?????????????


    at F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\bin-build\node_modules\execa\index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)

> optipng-bin@7.0.1 postinstall F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\optipng-bin
> node lib/install.js

connect ETIMEDOUT 182.43.124.6:443
optipng pre-build test failed
compiling from source
Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "./configure --with-system-zlib --prefix="F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\optipng-bin\vendor" --bindir="F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules
\optipng-bin\vendor""
'.' ????????????????????????е????
?????????????


    at F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\bin-build\node_modules\execa\index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)

> pngquant-bin@6.0.1 postinstall F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\pngquant-bin
> node lib/install.js

connect ETIMEDOUT 182.43.124.6:443
pngquant pre-build test failed
compiling from source
Error: pngquant failed to build, make sure that libpng-dev is installed
    at F:\BaiFuWangCode\nongkou-jd-home-admin\node_modules\bin-build\node_modules\execa\index.js:231:11
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Promise.all (index 0)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\vue-puzzle-vcode\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: gifsicle@5.2.1 (node_modules\gifsicle):
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 WARN optional SKIPPING OPTIONAL DEPENDENCY: mozjpeg@7.1.1 (node_modules\mozjpeg):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mozjpeg@7.1.1 postinstall: `node lib/install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optipng-bin@7.0.1 (node_modules\optipng-bin):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: optipng-bin@7.0.1 postinstall: `node lib/install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pngquant-bin@6.0.1 (node_modules\pngquant-bin):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: pngquant-bin@6.0.1 postinstall: `node lib/install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

added 2357 packages from 2158 contributors in 541.076s

52 packages are looking for funding
  run `npm fund` for details

看着这长长的报错,不知道我的内心是有点崩溃的,再加上1点点强迫症,怎么看都是不舒服,网上找解决方法,说是修改host文件,我也尝试修改host文件了,但是仍然为这个错误折腾了一天的时间。特此记录下。

1.修改host文件:

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

2.检查IP是否可以正常使用,不能使用进行修改

正常情况下在host文件中添加以上内容就可以正常使用安装了。但是不同时间段这些IP地址也可能失效,所以你可以在网站[域名查iP 域名解析 iP查询网站 iP反查域名 iP反查网站 同一iP网站 同iP网站域名iP查询 (ip138.com)](https://site.ip138.com/)上复制网址查询下IP,如果IP已经失效,把IP进行更换即可。例如:复制raw.githubusercontent.com 到IP查询网站上查询现在这个域名对应的IP是什么,进行修改,以上所有网址的IP尽量修改为同一个,成功率会高一些。我之前觉得优先使用国内的及港澳台的IP,导致使用了多个IP,尝试安装仍然会有问题。

3.时间问题

这个时间是指安装时间。我在安装的时候遇见过第一次安装成功了,但是第二次在执行同样的代码,同样的安装步骤,在不同的时间段安装的结果是不一样的。所以,有时候安装不了,不一定是你配置的问题而是网络的问题。就先干其他工作,等到第二天在试(可能也跟电脑重新启动有关系)。让后就成功了。