我无法在 Win Subsystem for Linux 的 Visual Studio Code 中创建文件或目录

Ale*_*cik 13 visual-studio-code windows-subsystem-for-linux

我使用本指南。当我执行“添加源代码文件”步骤时,会看到以下报告:

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')
Run Code Online (Sandbox Code Playgroud)

我不知道该怎么办,有人可以帮助我吗?

小智 32

VScode 因此需要权限

在 WSL 终端上试试这个命令

sudo chown -R username /path/to/working/directory
Run Code Online (Sandbox Code Playgroud)

代替 :

'username' 包含您的用户名和目录路径