天天看點

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,一切都清淨了。

繼續閱讀