Hexo降级到v2.8.3小记

今天手贱想把hexo升级到3.0,结果升级失败,又听说新版对主题支持不好,所以就先不折腾了,还是先安心用2.8.3吧。期间比较折腾,降级之后就记录一下。本文是在Mac OSX 10.9.5下面操作的。
1月份的时候装hexo就一个命令npm install hexo -g了事,现在有了新版hexo,想装2.8.3就没那么顺利咯~~~

版本信息

先把目前版本信息贴出来:(降级期间试过nodejs v0.12.4,结果不行,还是装回v0.10.36

rmbp15:hexo-blog simon$ node --version
v0.10.36
rmbp15:hexo-blog simon$ npm --version
1.4.28
rmbp15:hexo-blog simon$ hexo --version
hexo: 2.8.3
os: Darwin 13.4.0 darwin x64
http_parser: 1.0
node: 0.10.36
v8: 3.14.5.9
ares: 1.9.0-DEV
uv: 0.10.30
zlib: 1.2.8
modules: 11
openssl: 1.0.1l

安装hexo 2.8.3

执行命令

$sudo npm install hexo@2.8.3 -g

等待过程中报错

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

Google之后知道需要装Xcode,我找了Xcode v6.0.1版本,装了之后执行

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

安装好hexo,执行hexo init以及npm install之后把source, themes, _config.yml拷过去,再执行hexo g报错:

[error] HexoError: Process failed: _posts/hello-world.md
TypeError: Cannot read property 'config' of null
    at module.exports (/Users/simon/temp/hexotest/node_modules/hexo-renderer-marked/lib/renderer.js:55:10)
    at /usr/local/lib/node_modules/hexo/lib/extend/renderer.js:78:38
        at b (domain.js:183:18)
    at Domain.run (domain.js:123:23)
    at store.(anonymous function) (/usr/local/lib/node_modules/hexo/lib/extend/renderer.js:77:9)
    at /usr/local/lib/node_modules/hexo/lib/core/render.js:96:9
        at fn (/usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:638:34)
    at Object._onImmediate (/usr/local/lib/node_modules/hexo/node_modules/async/lib/async.js:554:34)
    at processImmediate [as _immediateCallback] (timers.js:354:15)

Google之后发现是因为相关插件的版本不对。在hexo 2.8.3下要安装指定版本的插件:

npm install hexo-renderer-ejs@0.1.0 hexo-renderer-marked@0.1.0 hexo-renderer-stylus@0.1.0

终于搞好了,轻松~~ 以后合适的时候再来玩玩hexo 3.0