标题安装hexo环境
复制代码
1
2
3
4sudo apt-get update sudo apt-get install nodejs sudo apt-get install npm
查看nodejs和npm版本号,验证是否安装完成
复制代码
1
2
3nodejs -v npm -v
安装 Hexo
在原hexo博客目录下安装
复制代码
1
2sudo npm install -g hexo-cli
测试是否安装成功
复制代码
1
2hexo server
到http://localhost:4000
下查看服务器是否正常启动
关联github
参考博客
首先生成ssh秘钥
复制代码
1
2ssh-keygen -t rsa -C "youremail@example.com"
查看所生成的秘钥(其地址在上述创建命令后的有展示)
复制代码
1
2show '秘钥文件'
复制本地ssh秘钥到github上重新创建一个,然后检验
复制代码
1
2ssh -T git@github.com
显示下列文字代表关联成功
复制代码
1
2
3
4
5The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? # 直接输入yes Hi cnfeat! You've successfully authenticated, but GitHub does not provide shell access
然后就可以hexo g
/hexo d
了
标题遇到的问题
关联秘钥成功后,hexo d
报错:
复制代码
1
2
3
4
5
6
7fatal: LF would be replaced by CRLF in 2020/07/18/AVLTree/index.html FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html Error: Spawn failed at ChildProcess.<anonymous> (/mnt/d/git/git_tutorial/work/blog/hexo/node_modules/hexo-util/lib/spawn.js:51:21) at ChildProcess.emit (events.js:315:20) at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
解决参考博客
运行下列命令后解决
复制代码
1
2git config --global core.autocrlf false
问题原因:
git在windows下,默认是CRLF作为换行符,git add 提交时,检查文本中有LF 换行符(linux系统里面的),则会告警。所以问题的解决很简单,让git忽略该检查即可
最后
以上就是从容刺猬最近收集整理的关于重装系统hexo博客重装的全部内容,更多相关重装系统hexo博客重装内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复