VS Code 在更新后无法加载扩展,并且无法安装新扩展。

huangapple go评论50阅读模式
英文:

VS code failed to load extensions and failed to install new extension after an update

问题

今天我在几天后重新打开了我的VS Code,发现我安装并长时间使用的扩展完全消失了,并且建议我安装Java扩展。好的,我按照建议安装扩展,但失败了。

我检查了我的Code版本,它肯定是最新版本。
然后我深入日志并尝试安装一些其他扩展,发现失败总是与一个名为sharedProcessMain.js的js文件有关。详细日志如下:

2023-02-16 09:32:06.725 [error] SyntaxError: JSON输入意外结束
    在JSON.parse (<anonymous>)
    在Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
2023-02-16 09:32:06.771 [error] JSON输入意外结束: SyntaxError: JSON输入意外结束
    在JSON.parse (<anonymous>)
    在Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)

有人能提供建议吗?非常感谢!

英文:

Today I reopen my VS Code after several days, found the extensions that I installed and used for a long time disappeared totally, and it recommended me to install extension for java. OK, I followed the recommends to install extension, and failed.

I checked my Code version, it's the latest version surely.
Then I dipped into the log and tried to install some other extensions, and found the failure always related to one js file sharedProcessMain.js. The detail log is as following:

2023-02-16 09:32:06.725 [error] SyntaxError: Unexpected end of JSON input
    at JSON.parse (&lt;anonymous&gt;)
    at Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)
2023-02-16 09:32:06.771 [error] Unexpected end of JSON input: SyntaxError: Unexpected end of JSON input
    at JSON.parse (&lt;anonymous&gt;)
    at Object.factory (vscode-file://vscode-app/d:/Users/MI/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:88:93520)

If anyone who can provide any suggestion? Thank you very much!

答案1

得分: 2

我使用Windows,昨天也遇到了相同的问题。通过以下步骤解决了它:

  1. 关闭VSCode
  2. 删除整个文件夹%appdata%\Code
  3. 删除整个文件夹%userprofile%\.vscode
  4. 启动VSCode

希望对你有帮助。

英文:

On what OS are you running?

I use Windows and I faced the same problem yesterday. Solved it by

  1. Closing VSCode
  2. Removing the entire folder %appdata%\Code
  3. Removing the entire folder %userprofile%\.vscode
  4. Starting VSCode

Hope this helps.

huangapple
  • 本文由 发表于 2023年2月16日 09:50:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75467084.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定