Node
下载网站:https://nodejs.org/en/download
Node.js 为大多数平台提供了官方的 安装程序。对于中国大陆地区用户,可以前往 淘宝 Node.js 镜像 下载。
Node.js (Node.js 版本需不低于 10.13,建议使用 Node.js 12.0 及以上版本)
下载预构建的二进制文件
node版本Gitbook版本限制在14左右,hexo不同版本会有一些插件报错。
将下载后的压缩包解压到安装目录后,在电脑系统环境变量path里添加node的路径即可。
Node.js 版本限制
如果你坚持使用旧的 Node.js,你可以考虑安装 Hexo 的过去版本。
请注意,我们不提供对过去版本 Hexo 的错误修复。
我们强烈建议永远安装 最新版本 的 Hexo,以及 推荐的 Node.js 版本。
Hexo 版本 最低版本 (Node.js 版本) 最高版本 (Node.js 版本) 7.0+ 14.0.0 latest 6.2+ 12.13.0 latest 6.0+ 12.13.0 18.5.0 5.0+ 10.13.0 12.0.0 4.1 - 4.2 8.10 10.0.0 4.0 8.6 8.10.0 3.3 - 3.9 6.9 8.0.0 3.2 - 3.3 0.12 未知 3.0 - 3.1 0.10 或 iojs 未知 0.0.1 - 2.8 0.10 未知
Git
- Windows:下载并安装 git。
- Mac:使用 Homebrew, MacPorts 或者下载 安装程序。
- Linux (Ubuntu, Debian):
sudo apt-get install git-core
- Linux (Fedora, Red Hat, CentOS):
sudo yum install git-core
Mac 用户
如果在编译时可能会遇到问题,请先到 App Store 安装 Xcode,Xcode 完成后,启动并进入 Preferences -> Download -> Command Line Tools -> Install 安装命令行工具。
Windows 用户
对于中国大陆地区用户,可以前往 淘宝 Git for Windows 镜像 下载 git 安装包。
hexo安装
全局安装
所有必备的应用程序安装完成后,即可使用 npm 安装 Hexo。
1 | $ npm install -g hexo-cli |
局部安装和使用
对于熟悉 npm 的进阶用户,可以仅局部安装 hexo
包。
1 | $ npm install hexo |
安装以后,可以使用以下两种方式执行 Hexo:
npx hexo <command>
- Linux 用户可以将 Hexo 所在的目录下的
node_modules
添加到环境变量之中即可直接使用hexo <command>
:
1 | echo 'PATH="$PATH:./node_modules/.bin"' >> ~/.profile |
Butterfly主题安装与配置
1 | git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly |
参考链接:https://butterfly.js.org/posts/21cfbf15/#%E5%AE%89%E8%A3%9D
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Works!
评论
WalineUtterances