home archives github knives links
tags git hexo 阿里云
categories
only title title and content
hexo搭建博客

搭建

git全局配置

git config --global user.name "Lynx" # your student ID and name
git config --global user.email "1197225628@qq.com" # your email
git config --global core.editor vim # your favorite editor
git config --global color.ui true

安装node.js

安装npm和hexo,搭建博客

知乎

简要过程

sudo apt-get install nodejs # ubuntu
sudo apt-get install npm # ubuntu
sudo npm install -g hexo
# 如果出现错误: sudo npm cache clean --force # 一定要加 sudo
# 进入到文件夹
hexo init
npm cache clean --force
sudo npm install # 安装必须的npm包
# npm install hexo-deployer-git --save # 找不到deployer
# npm install hexo-server # hexo s 无效

绑定个人域名

常见错误

  1. 不缺失主题的前提下no layout
    • 直接hexo clean
    • 使用npm ls查看是否存在缺失,npm install+npm audit fix安装缺失的包