建站日志

博客-建站日志

变更记录

序号 | 录入时间 | 备注
— | — | — | —
1 | 2017-05-03 | 新建文章
2 | 2018-02-28 | 整理博客问题,添加问题8
3 | 2019-01-26 | 更换博客图床,add HTTPS认证
4 | 2019-01-27 | 更换DNS解析到Cloudflare
5 | 2019-07-20 | 恢复本地搜索

TODO

  • 整理,优化文章level2

  • 文章底部添加推荐和最新评论

  • 推广-SEO优化

  • CDN解析加速

  • 添加文章版权

2019

  • 恢复本地搜索
  • 整理,优化文章level1
  • 新建分支,同步备份
  • 站点日志独立区块,添加笔记心得

2018

  • 更换melody hexo主题
  • HTTPS认证2019-01-26
  • About页面的优化,title修改
  • Tag标签位置问题

2017

  • add tags. (2017-04-26)
  • add heart click. (2017-04-26)
  • use MWeb to manage. (2017-04-26)
  • add comments. (2017-05-02)
  • add article views and number of people. (2017-05-03)
  • add backup to cloud. (2017-05-03)
  • use imgur to add pic.

3月

搭建Hexo,使用Next主题; 2017-03-05

4月

添加点击效果; 2017-04-26

使用MWeb自动发布; 2017-04-26

5月

添加评论

(Hexo blog add comments) 2017-05-02

添加音乐 2017-05-02

备份Bitbucket备份 2017-05-02

添加查看次数和人数;2017-05-02

添加搜索

  • Local Search2017-05-02
  • 解决输入未实时搜索的情况; 2017-05-10,(重新配置了一下。)

绑定域名frizzlefur.com 2017-05-13

(购买域名,添加解析,绑定域名)

添加字数统计 2,850 | 阅读时长 13Hexo博客设置进阶

2017-05-15

配置问题

  1. Error: The module “…” was compiled against a different Node.js version using NODE_MODULE_VERSION…
    实际报错信息:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Error: The module '/usr/local/lib/node_modules/hexo-cli/node_modules/hexo-log/node_modules/bunyan/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
    was compiled against a different Node.js version using
    NODE_MODULE_VERSION 46. This version of Node.js requires
    NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
    the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (module.js:672:18)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/hexo-cli/node_modules/hexo-log/node_modules/bunyan/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    参考
    1
    2
    3
    4
    5
    Error: The module '/usr/local/lib/node_modules/hexo/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node'
    was compiled against a different Node.js version using
    NODE_MODULE_VERSION 51. This version of Node.js requires
    NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
    the module (for instance, using `npm rebuild` or `npm install`).
    看到这我意识到之前全局安装的文件都没更新过!
    执行以下代码:
    1
    sudo npm install -g hexo-cli 
    解决了

参考 记一次 Hexo 报错经历 |

1. 多个 SSH Key 的切换问题

Error1:
Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

解决方法:

  1. 检查需要提交的 Github 账号的 SSH Key
  2. ~/.ssh/ 中查看rsa文件
  3. 添加对应的 rsa 文件 ssh-add ~/.ssh/id_rsa_support
  4. 使用 ssh -T git@github.com 测试对应账号是否连接成功

Error2:
HEXO DEPLOY 时不断 Error: Permission denied (publickey). fatal: Could not read from remote repository. #1478

解决方法:

换成https之后把 deployer_git 文件夹删除,重新 hexo deploy
这样的话需要输入用户名密码,看一下能否正常提交。

2. 多个Git账号切换问题

参考Quick Tip: How to Work with GitHub and Multiple Accounts

参考[Pushing to Git returning Error Code 403 fΩ/stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed)

3. 解决Hexo的 Tags 显示问题 2017-04-26

请参阅 Hexo 的分类与标签文档,了解如何为文章添加标签或者分类。

1. 新建页面
在终端窗口下,定位到 Hexo 站点目录下。使用 hexo new page 新建一个页面,命名为 tags :

1
2
$ cd your-hexo-site
$ hexo new page tags

2. 设置页面类型
编辑刚新建的页面,将页面的类型设置为 tags ,主题将自动为这个页面显示标签云。页面内容如下:

1
2
3
4
title: 标签
date: 2014-12-22 12:39:04
type: "tags"
---

3. 修改菜单
在菜单中添加链接。编辑 主题配置文件,添加 tags 到 menu 中,如下:

1
2
3
4
menu:
home: /
archives: /archives
tags: /tags

4. Cannot find module 'bluebird' 2017-05-03

ERROR Plugin load failed: hexo-algolia Error: Cannot find module 'bluebird'

解决方法:

install the bluebird package locally.
npm install --save bluebird

参考Node.js ERROR Error: Cannot find module ‘bluebird’

5. Error: Cannot find module 'hexo-util 2017-05-03

解决方法:
$ npm install -- save-dev hexo-util

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
MacBook-Pro:_posts michaelmao$ npm install -- save-dev hexo-util
/
> hexo-util@0.6.0 postinstall /Users/michaelmao/Desktop/MyResouce/MyBlogResource/myblog/frizzlefur.github.io/node_modules/hexo-util
> npm run build:highlight


> hexo-util@0.6.0 build:highlight /Users/michaelmao/Desktop/MyResouce/MyBlogResource/myblog/frizzlefur.github.io/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json

save-dev@2.0.0 ../../node_modules/save-dev

hexo-util@0.6.0 ../../node_modules/hexo-util
├── striptags@2.2.1
├── html-entities@1.2.1
├── camel-case@3.0.0 (upper-case@1.1.3, no-case@2.3.1)
├── highlight.js@9.11.0
└── cross-spawn@4.0.2 (lru-cache@4.0.2, which@1.2.14)

参考Cannot find module ‘hexo-util’ #1480

6. ERROR Deployer not found: git 2017-05-10

执行完以后,如果报错 Error: Deployer not found : github,则执行如下命令:

1
npm install hexo-deployer-git --save

同时修改 _config.yml :

1
2
3
4
5
6
deploy:
type: git //改成github
然后再执行:
hexo generate

hexo deploy

7. ERROR Plugin load failed: hexo-deployer-git 2017-07-09

hexo的提交到git的插件可能坏了,重装一下

1
npm install hexo-deployer-git --save

8. 解决Hexo命令fs.SyncWriteStream问题 2018-02-28

nodejs版本更新到8.0之后,运行hexo相关命令总会出现这么一行鬼东西:
(node:538) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.
虽然不怎么影响大局,当对于强迫症来说是一个噩梦

nodejs8.0开始已经弃用了fs.SyncWriteStream方法,但是某些插件里面还是用到这个方法。查看Hexo项目也有这个一条issue,在hexo项目中其中有一个hexo-fs的插件调用了这个方法,所以需要更新hexo-fs插件,更新方法如下:

nodejs8.0开始已经弃用了fs.SyncWriteStream方法,但是某些插件里面还是用到这个方法。查看Hexo项目也有这个一条issue,在hexo项目中其中有一个hexo-fs的插件调用了这个方法,所以需要更新hexo-fs插件,更新方法如下:

1
npm install hexo-fs --save

参考:基于Hexo+Github+Coding搭建个人博客——基础篇(从菜鸟到放弃) | ookamiAntD’s Blog

但是发现使用这个方法时候,我是直接在第一行报的错。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
❯ hexo d -g --debug
(node:4686) [DEP0061] DeprecationWarning: fs.SyncWriteStream is deprecated.
03:21:56.280 DEBUG Hexo version: 3.3.5
...
03:21:56.403 DEBUG Script loaded: themes/next/scripts/merge-configs.js
03:21:56.406 DEBUG Script loaded: themes/next/scripts/merge.js
03:21:56.406 DEBUG Script loaded: themes/next/scripts/tags/button.js
03:21:56.406 DEBUG Script loaded: themes/next/scripts/tags/center-quote.js
03:21:56.480 DEBUG Script loaded: themes/next/scripts/tags/exturl.js
03:21:56.481 DEBUG Script loaded: themes/next/scripts/tags/full-image.js
03:21:56.482 DEBUG Script loaded: themes/next/scripts/tags/group-pictures.js
03:21:56.482 DEBUG Script loaded: themes/next/scripts/tags/note.js
03:21:56.671 DEBUG Plugin loaded: hexo-deployer-git
03:21:56.793 DEBUG Plugin loaded: hexo-fs
03:21:56.796 DEBUG Plugin loaded: hexo-generator-archive
03:21:56.800 DEBUG Plugin loaded: hexo-generator-category
03:21:56.803 DEBUG Plugin loaded: hexo-generator-index
03:21:56.808 DEBUG Plugin loaded: hexo-generator-searchdb
03:21:56.811 DEBUG Plugin loaded: hexo-generator-tag
03:21:56.818 DEBUG Plugin loaded: hexo-renderer-ejs
03:21:56.917 DEBUG Plugin loaded: hexo-renderer-marked
03:21:56.918 DEBUG Plugin loaded: hexo-renderer-stylus
03:21:57.034 DEBUG Plugin loaded: hexo-server
03:21:57.217 DEBUG Plugin loaded: hexo-toc
03:21:57.282 DEBUG Plugin loaded: hexo-wordcount

参考 Hexo博客注意事项 | RangerZhou,还是没有完全解决,现在hexo version就会报警告

文章作者: MichaelMao
文章链接: http://frizzlefur.com/2017/05/03/%E5%8D%9A%E5%AE%A2-%E5%BB%BA%E7%AB%99%E6%97%A5%E5%BF%97/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 MMao
我要吐槽下