在这个过程中会报错,特此记录
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后,就可以把它当作密码使用,成功