chenzhutian / hexo-all-minifier

A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.
MIT License
275 stars 30 forks source link

Can't install? #101

Closed forliuyifei closed 3 years ago

forliuyifei commented 4 years ago
$ npm install hexo-all-minifier --save

> gifsicle@4.0.1 postinstall C:\Users\Xin\Desktop\hexo\loafing\node_modules\gifsicle
> node lib/install.js

  ‼ getaddrinfo ENOENT raw.githubusercontent.com
  ‼ gifsicle pre-build test failed
  i compiling from source
  × Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf"
'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���

    at C:\Users\Xin\Desktop\hexo\loafing\node_modules\execa\index.js:231:11
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\hexo-blog-encrypt\node_modules\fsevents):
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: fsevents@1.2.13 (node_modules\hexo-admin\node_modules\fsevents):
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: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle@4.0.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gifsicle@4.0.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
KumaNNN commented 3 years ago
npm install hexo-all-minifier --save --ignore-scripts
nathaniel2020 commented 3 years ago
npm install hexo-all-minifier --save --ignore-scripts

i use this, and it install correctly, but i can't use hexo g, the erros as follows

Error: write EOF at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:92:16)

when i uninstall the hexo-all-minifier, hexo g can work

DefectingCat commented 3 years ago
npm install hexo-all-minifier --save --ignore-scripts

that can not slove the problem , just ignore the scripts, actually it's can not work with hexo g.

the error log is : Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf" in a long time , i thought that it's my windows can't run autoconf, though i installed cygwin. but actually that is "network problem".

the truly problem is can not connect with raw.githubusercontent.com.

So, try write it in your hosts:

52.74.223.119     github.com
192.30.253.119    gist.github.com
54.169.195.247    api.github.com
185.199.111.153   assets-cdn.github.com
151.101.76.133    raw.githubusercontent.com
151.101.76.133    gist.githubusercontent.com
151.101.76.133    cloud.githubusercontent.com
151.101.76.133    camo.githubusercontent.com
151.101.76.133    avatars0.githubusercontent.com
151.101.76.133    avatars1.githubusercontent.com
151.101.76.133    avatars2.githubusercontent.com
151.101.76.133    avatars3.githubusercontent.com
151.101.76.133    avatars4.githubusercontent.com
151.101.76.133    avatars5.githubusercontent.com
151.101.76.133    avatars6.githubusercontent.com
151.101.76.133    avatars7.githubusercontent.com
151.101.76.133    avatars8.githubusercontent.com

then try ping raw.githubusercontent.com.

批注 2020-08-04 135351

if it's worked , then try hexo-all-minifier again:

# in your blog
rm -rf node_modules/
# or npm install
npm install hexo-all-minifier --save

批注 2020-08-04 135700

enjoy.

How to edit hosts Same error

WL2O2O commented 11 months ago

衷心建议: 安装失败的老铁们,别管各种不一样的报错,我的各种报错都没有在上面提到的issues中找到,仔细看报错内容提示,该重启的时候就重启,该上梯子就上梯子(不行就全局模式),卸载依赖:npm uninstall hexo-all-minifier;安装依赖:npm install hexo-all-minifier --save,这两个命令反复多来几次,就会忽然发现,安装成功了!!!!最后吐槽一句,被墙真不友好!!! English version: Sincere suggestions: The old iron workers who failed to install, regardless of the different error reports, my various errors were not found in the issues mentioned above. Carefully read the error report content prompt, restart when it is time to restart, go up the ladder when it is time to restart (global mode if not possible), uninstall dependency: 'npm uninstall hexo all minifier'; Installation dependency: 'npm install hexo all minifier -- save'. Repeat these two commands several times and suddenly realize that the installation was successful!!!! In the end, roast that it was really unfriendly to be on the wall!!!