mac中vscode更新不了,解决之道

909 阅读1分钟

我升级vscode的时候,遇到了升级不了的情况,每次都是报错:

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. This might mean the application was put on quarantine by macOS. See this link for more information.

最终走了3步解决了vscode升级不了的问题:

1.改变vscode更新缓存文件的所有者(第一步)

作用: 将VSCode的更新缓存文件的所有者改为当前用户,以便用户可以对这些文件进行修改。

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

2. 移除VSCode应用程序的隔离状态(第一步)

作用: 递归地删除VSCode应用程序的隔离状态,以便VSCode可以正常运行。

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

ps: 在运行这些命令之前,你需要确保你有足够的权限,否则你可能需要输入管理员密码。

3. 打开mac中的系统设置面板的隐私与安全性选项

开发者工具中添加 vscode(第三步)