Hexo 命令失效解决

Hexo是一个非常好用的静态博客生成器,但是由于很多方面的原因,导致在使用过程中经常出现错误。

今天在启动服务器服务器的时候,一直出现hexo help 的执行页面:

Usage: hexo

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/

尝试了hexo的其他命令,都是如此。

之前用的时候都是正常的,突然就出幺蛾子,好气哦!

气归气,还是得把问题先解决、

1. 首先找原因
hexo --debug #可查看错误原因

错误信息:

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html

Error: EACCES: permission denied, open '/data/www/blog/blog/db.json'

02:54:39.113 FATAL EACCES: permission denied, open '/data/www/blog/blog/db.json'

Error: EACCES: permission denied, open '/data/www/blog/blog/db.json'

OK,原因找到了,一目了然,该死的权限问题

2. 解决问题

将/data/www/blog/blog/db.json文件赋予读写权限
重新执行

hexo --debug

执行结果
在这里插入图片描述
好啦,报错信息木有啦,问题解决

3. 重启服务器
hexo server #重新启动

出现以下信息,说明启动成功:

图片: https://uploader.shimo.im/f/ryzs0gjlUG0tSUZo.png

访问 http://localhost:4001, 成功~

hexo默认端口是4000,我本地端口配置的是4001

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值