MacOS hexo搭建GitHub网站

在这个过程中会报错,特此记录

1. 安装hexo init blog 时,出现WARN Failed to install dependencies. Please run ‘npm install‘ in...

换源可以解决问题,于是乎在命令行运行

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

继续报错

继续查,发现证书已过期,所以使用新的镜像源

npm config set registry https://registry.npmmirror.com
npm i -g nrm
nrm ls

2. 在执行hexo deploy 命令时,输入用户名和密码的时候报错

remote: Support for password authentication was removed on August 13, 2021.

remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.

致命错误:'https://github.com/ZhouKain/Moody-Musings.github.io.git/' 鉴权失败

大概意思呢就是说,密码验证身份的方式已经在2021年的8月份被移除了。请使用个人的token代替

在github的官方文件中,访问

 https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

按照它的步骤,创建一个  Token。

第六步的 descriptive name  可以随便写,不影响。第八步把带有  repo的都勾上去

这个第八步,我要多说一下,也可以把全部都勾上。这一步就是授予这个token权限的,全勾上就意味着把全部的权限都给了它。给全部权限也是可以的,就相当于账户的  登录密码啦。全部勾上的话,等以后就可以使用这个token 在IDEA很方便快速的使用  token的方式登录  GitHub

获得token后,就可以把它当作密码使用,成功​​​​​​​

参考:https://www.cnblogs.com/visugar/p/6821777.html

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值