关于安装hexo遇到的一些问题

安装Hexo
Hexo就是我们的个人博客网站的框架, 这里需要自己在电脑常里创建一个文件夹,可以命名为Blog,Hexo框架与以后你自己发布的网页都在这个文件夹中。
创建好后,进入文件夹中,按住shift键,右击鼠标点击命令行
使用npm命令安装Hexo,
输入:npm install -g hexo-cli (参考:https://zhuanlan.zhihu.com/p/26625249)
在这里可能会出现:
npm 安装报错 :(参考:https://blog.csdn.net/qq_31945977/article/details/81537917)
rollbackFailedOptional verb npm-session
此时使用cnpm的获取镜像
1.安装cnpm
(1) 输入以下命令

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

修改npm的资源镜像链接

npm config set registry http://registry.npm.taobao.org

之后,初始化我们的博客(参考:https://zhuanlan.zhihu.com/p/26625249)
输入:hexo init blog
注意,这里的命令都是作用在刚刚创建的Blog文件夹中。为了检测我们的网站雏形,分别按顺序输入以下三条命令:
hexo new test_my_site

hexo g

hexo s
然后在输入上面三条语句的过程中可能出现下面这种情况

Usage: hexo <command>

Commands:
  help     Get help on a command.  init     Create a new Hexo folder.  version  Display version information.
Global Options:
  --config  Specify config file instead of using _config.yml  --cwd     Specify the CWD  --debug   Display all verbose messages in the terminal  --draft   Display draft posts  --safe    Disable all plugins and scripts  --silent  Hide output on console
For more help, you can use 'hexo help [command]' for the detailed information
or you can check the docs: http://hexo.io/docs/

此时按顺序输入下列语句(参考:https://www.xttblog.com/?p=1807)

1.hexo init C:/hexo 
2.cd C:/hexo
3.npm install

然后在执行hexo server命令,即可成功启动服务

hexo server

在这里插入图片描述
然后打开浏览器输入localhost:4000
就可以看到下面的界面了
在这里插入图片描述

  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值