Code change:
throw new Error(nls.localize('restartCode', "Please restart VS Code before reinstalling {0}.", this.manifest.displayName || this.manifest.name)); } } <del> } else { // Remove the extension with same version if it is already uninstalled. // Installing a VSIX extension shall replace the existing extension always. const existingWithSameVersion = await this.unsetIfUninstalled(this.extensionKey); if (existingWithSameVersion) { try { await this.extensionsScanner.removeExtension(existingWithSameVersion, 'existing'); } catch (e) { throw new Error(nls.localize('restartCode', "Please restart VS Code before reinstalling {0}.", this.manifest.displayName || this.manifest.name)); } </del> <ins> } // Remove the extension with same version if it is already uninstalled. // Installing a VSIX extension shall replace the existing extension always. const existingWithSameVersion = await this.unsetIfUninstalled(this.extensionKey); if (existingWithSameVersion) { try { await this.extensionsScanner.removeExtension(existingWithSameVersion, 'existing'); } catch (e) { throw new Error(nls.localize('restartCode', "Please restart VS Code before reinstalling {0}.", this.manifest.displayName || this.manifest.name)); </ins> } }

Related discussion:
text: When I use the command line code --install-extension {id} Cannot find the installed extension Vscode - userdata: $HOME /. Vscode/extensions/extensions. The json. This error only appears in version 1.90.0, but does not exist if you go back to version 1.89.0.
This only happened the first time, and it worked the second time I executed the command line to install the plugin. So did everyone else around
Are you still seeing this issue? If so can you please provide steps to reproduce?
My plug-in is a private plug-in that updates through the code command. When I released the updated version of the plug-in, I used the code command to update it, and there would be an error the first time, and it would be successful the second time, which was stable. !
TLDR: The issue happens when a version that was installed before is installed again I have pretty much the same scenario. A private extension that uses to update itself when a new version is available. This is the error that's logged: I do have an entry for my extension in the file though: I did some testing on a bare project to understand the failure mechanism. What I found out is that if a particular version of the extension is installed before (for example during my testing before I release the extension) then upgrading/downgrading to that version will fail. Using following steps I can reproduce this issue reliably: 1- Create a bare project: 2- Package the extension: 3- Increment the version number, and package again: 4- Install the first package: 5- Update to second package: So far everything is in order. The problem begins when we try to install any of those packages again: 6- Downgrade to first package: At this point the neither 0.0.1 nor 0.0.2 is shown as installed. So installing any of them will be successful. this explains why you're always getting the error on the first, but the second round is successful. 7- Install the first package again: 8- Update to second package again: Tested this with Windows and WSL Ubuntu. Happens only on WSL Ubuntu in my case.
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected.