1. 问题
因为区块链需要用到linux系统,但是使用虚拟机进行安装的话,会导致双系统都卡顿,因此选择WSL进行ubuntu的安装。并使用vscode进行代码的管理,但是在vscode配置好之后,向文件中写入代码时出现如下错误
Unable to write file 'vscode-remote://wsl+ubuntu-20.04/home/alex/TEST/helloworld/helloworld' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/home/alex/TEST/helloworld/helloworld')
2. 问题产生原因
原因是在windows中改变ubuntu子系统中的文件,我们没有足够的权限。
3. 解决方法
# 其中username为ubuntu子系统的用户名
# path 为当前文件所在的目录
sudo chown -R username /path/to/working/directory
执行完成该指令后问题解决。能够正常使用vscode修改ubuntu子系统的代码。