macOS VS Code "Cannot update while running on a read-only volume"错误

今天打开VS Code,编辑一个md文件的时候,按回车提示错误而且回车输入无效:
"command 'markdown.extension.onEnterKey"
搜了一下,说是VS Code版本应该升级。想来是插件自动升级了,VS Code没跟上。

然后尝试Code-检查更新,居然提示不能在只读卷上升级:
Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you’re on macOS Sierra or later, you’ll need to move the application out of the Downloads directory. See this link for more information.

WTF?我明明是放在Application文件夹里面的啊。
然后一通搜,搜到解决方案:Code won’t update on macOS · Issue #7426 · Microsoft/vscode
简言之,运行如下两个命令即可:

sudo chown -R $USER ~/Library/Caches/com.microsoft.VSCode.ShipIt

xattr -dr com.apple.quarantine /Applications/Visual\ Studio\ Code.app

然后再次更新并重启VS Code,一切都清净了。

你可能感兴趣的:(Visual,Studio,Code)