vscode-extensionsfailed-installation

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


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 (<anonymous>)
    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 (<anonymous>)
    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!


Solution

  • 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.