官网下载地址:https://nodejs.org/en/
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-QQu1hM9Y-1656331719812)(C:\Users\Administrator.SC-201902031211\AppData\Roaming\Typora\typora-user-images\image-20220626211032683.png)]](https://1000bd.com/contentImg/2022/06/29/061622712.png)
win+r 输入 cmd进入命令行,查看node版本
node -v
npm -v

安装cnpm,使用国内镜像淘宝
npm install -g cnpm --registry=https://registry.npm.taobao.org
查看是否安装成功

cnpm install -g hexo-cli
验证是否安装成功
hexo -v

创建blog文件夹(也可直接右键新建文件夹),并进入这个目录
mkdir blog
cd blog
初始化博客
hexo init

启动博客(hexo sever)
hexo s

访问地址:http://localhost:4000/
发表文章
hexo n "我的第一篇博客文章"

对source_posts\我的第一篇博客文章.md进行修改
清理
hexo clean
生成文章(hex generate)
hexo g

重新开启服务器,输入网址就可以看到发表的文章
hexo s

注意:仓库名字:域名.github.io

cnpm install --save hexo-deployer-git

修改_config.yml文件末尾的内容
repo里面填写github仓库地址
branch 填写分支

deploy:
type: 'git'
repo: 'https://github.com/dengerpu/vip.github.io.git'
branch: 'master'

hexo d
地址:https://vip.github.io
更改后的地址:https://dengerpu.github.io
最后发现vip域名被占用了,就换了个域名重新部署到远端(更改下仓库名,和_config.yml里面的配置,再次部署到远端即可 hexo d)
地址:https://github.com/litten/hexo-theme-yilia
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
theme: yilia

hexo clean
hexo g
hexo s
hexo d
hexo new "My New Post"
More info: Writing
hexo server
More info: Server
hexo generate
More info: Generating
hexo deploy
xo.io/docs/server.html)
### Generate static files(发送到服务器)
```shell
hexo generate
More info: Generating
hexo deploy