随笔 - 1  文章 - 0  评论 - 0  阅读 - 4

安装 Hexo

序言

  1. 安装和配置Git
  2. 安装NVM和Node
  3. 安装和配置Git

安装和配置Hexo

Git下载链接

# 安装Git
apt-get -y install git

# 配置Git
git config global user.name="testname"
git config global user.email="test@email.com"

安装NVM和Node

nvm文档
nvm-windows 下载链接

# 安装Node.js
# 检测npm和node是否安装
nvm -v

# nvm 已安装列表
nvm list
# nvm 远程可安装列表
nvm list available
# nvm 卸载指定版本
nvm uninstall [version]
# nvm 使用指定版本
nvm use [version]

# 安装顺序
nvm list available
nvm install [version]
nvm list
nvm use [version]
node -v
npm install npm -g

设置Nvm和Node镜像源

# 配置当前安装包的镜像源
npm install -g <安装包名> --registry=https://registry.npm.taobao.org
# 本次安装为当前配置的镜像源
npm install --registry=https://registry.npm.taobao.org   
# 查看当前镜像源
npm config get registry
# 修改~/.npmrc,加入以下内容
npm config set registry https://registry.npm.taobao.org   
registry = https://registry.npm.taobao.org   

使用cnpm更换npm

npm install -g cnpm --registry=https://registry.npm.taobao.org   

查看全局安装的包

npm -g list

安装和配置Hexo

Hexo 官网文档

# 全局安装 hexo
npm install -g hexo-cli
# 局部安装 hexo
npm install hexo
# 安装 Hexo 主题
git clone https://github.com/theme-next/hexo-theme-next /hexo/themes/next
# 修改_config.xml
# 主题
theme: next
# github部署
deploy:
  type: git
  repo: git@github.com:github名字/仓库名字
  branch: master
posted on   A50225  阅读(4)  评论(0编辑  收藏  举报
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示