#hexo

Spend a whole night working on updating Hexo. It is much more complicated than I expected. For anyone’s convenience, I record some key points when migrate from Hexo 2.x to 3.0 besides the official documentation.

First things first: uninstall Hexo

Yes. Though the official wiki says that we can directly migrate from 2.x to 3.0, this doesn’t work (to me). Besides, instead of wasting time figuring out what’s wrong when updating, re-installating and configurating Hexo 3.0 seems acceptable to me. You can try to update directly but I didn’t do that successfully.
Before your uninstallation, backup your posts and any other custom setting files (eg. _config.yml, your own theme file, etc).
To uninstall Hexo, use the node package manager(npm):

1
npm uninstall hexo 

Now, install Hexo 3.0

Run

1
$ sudo npm install -g hexo-cli

Hexo wiki doesn’t mention the administration permission, but in my experience we have to add sudo here.

Then we need to setup hexo folder in your desired place(folder).

1
2
3
$ hexo init <folder>
$ cd <folder>
$ sudo npm install

Still, try sudo when you fail to run any command.

For your future convenience, we install all necessary services here:

1
2
3
4
5
6
7
8
9
npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save

and any plugins you probably need:

1
2
3
4
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save

All in sudo mode (or you can directly do all of these in sudo -i mode).
Now, we finished installation.

Read More

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×