文件编辑权限问题 #2323

Open
z2x opened this Issue Dec 22, 2016 · 1 comment

Projects

None yet

2 participants

@z2x
z2x commented Dec 22, 2016 edited

操作系统:mac os10.12.2
编辑器:vs code
使用hexo -new创建文件会提示错误:

INFO  Created: /document/github-blog/source/_posts/1.md
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: EACCES: permission denied, open '/document/github-blog/db.json'
    at Error (native)
FATAL EACCES: permission denied, open '/document/github-blog/db.json'
Error: EACCES: permission denied, open '/document/github-blog/db.json'
    at Error (native)

使用sudo hexo new命令能够创建成功,但文件编辑没有权限:

未能保存“2.md”: 发生了系统错误(EACCES: permission denied, open '/document/github-blog/source/_posts/2.md')

这个问题应该如何解决呢?

@z2x z2x closed this Dec 22, 2016
@z2x z2x reopened this Dec 22, 2016
@NoahDragon
Member
NoahDragon commented Dec 22, 2016 edited

可以通过chown将db.json文件的权限更改为当前用户.

sudo chown $USER:$USER /document/github-blog/db.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment