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 #重新启动
出现以下信息,说明启动成功:
访问 http://localhost:4001, 成功~
hexo默认端口是4000,我本地端口配置的是4001