Install nvm (Node Version Manager)
1 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash |
If that fail, try manual install:
1 | git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags` |
Then add these lines to ~/.bashrc
, ~/profile
, or ~/.zshrc
:
1 | export NVM_DIR="$HOME/.nvm" |
At last, reopen your terminal or logout and login again.
Install Node and npm
nvm bundles node with npm (node package manager), so you only need to install node.
1 | nvm install node # this install the latest version of node |
Install hexo and init a blog
1 | npm install hexo-cli -g |
Done.
Reference: https://hexo.io/docs/index.html