• 本帖最后由 yidaomm 于 2018-9-9 22:12 编辑 *

用centOS-7-64 的最小安装系统。

yum update

之后安装:Node.js; Git;

安装 Git

yum install git-core

安装 Node.js

curl https://raw.github.com/creationix/nvm/master/install.sh | sh

wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

安装完成后,重启终端

安装 Node.js。

nvm install stable

之后,使用 npm 即可完成 Hexo 的安装

npm install -g hexo-cli;

提示:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [fsevents@1.2.4](mailto:fsevents@1.2.4) (node_modules/hexo-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [fsevents@1.2.4](mailto:fsevents@1.2.4): wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

================================================================

安装 Hexo 完成后,

执行下列命令:$ hexo init myblog; $ cd myblog; $ npm install

之后修改网站的配置信息 _config.yml

因为没建一篇文章,是不是 默认使用 _config.yml 中的 default_layout 参数代替

执行命令:# hexo g

提示:FATAL can not read a block mapping entry; a multiline key may not be an implicit key at line 10, column 7:
author:

原因:是因为hexo的yml配置文件 冒号后面少了空格;返回修改后:

再次执行命令:# hexo g ;

出现如下提示:

[root@alpnew blog]# hexo g
INFO Start processing
INFO Files loaded in 809 ms

执行命令:# hexo server

出现如下提示:

INFO Start processing
INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

搭建成功~~

之后,打开IP:4000;Hexo 搭建的网站可以访问~~