最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Failed to save: insufficient permissions in VSCode - Stack Overflow

programmeradmin0浏览0评论

I am trying to save a file, but every time I try to the following error (as shown in the image) es up. I run the code from the terminal using sudo and it still is not working and I tried changing owners of the file in the terminal, although I'm not sure if I did it correctly. Retry as sudo just pulls up the same error.

Image of error

I am trying to save a file, but every time I try to the following error (as shown in the image) es up. I run the code from the terminal using sudo and it still is not working and I tried changing owners of the file in the terminal, although I'm not sure if I did it correctly. Retry as sudo just pulls up the same error.

Image of error

Share Improve this question asked May 20, 2020 at 22:01 Nafnaf123Nafnaf123 111 silver badge3 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

You can change the ownership of you project file. That might work.

sudo chown -c -R $USER:$USER (project folder)

Explanation:

  • chown: change the ownership of files/directories
  • -c: report all changes
  • -R: do this recursively (for all files/directories beneath the given one)
  • $USER:$USER: change the owner and the group that owns the the entry to the user that issues the mand (sudo preserves the values)
  • (project folder): name of the folder which contains project files

You can test those environment variables with the following mands

echo $USER
sudo echo $USER
发布评论

评论列表(0)

  1. 暂无评论