The ProblemYou try to run a command—maybe it's 'Live Server' or a Prettier format—and VS Code hits you with a 'Command not found' alert. It is a confusing error. The extension shows as 'Installed' in your sidebar, yet the editor acts like it doesn't exist. This happens because while VS Code recognizes the command name from the extension's manifest, the actual background process (the Extension Host) failed to hook into the engine.
Why This HappensSeveral issues can break the link between a button and its code:
- The Extension Host process crashed silently in the background.- A missing dependency, like a specific Node.js version or a Python interpreter, blocked activation.- Your
package.jsonhas a typo in theactivationEventssection.- The local extension cache is corrupted after a messy update.- The extension is too new (or too old) for your current VS Code version.## Step-by-Step Fixes### 1. Perform a Developer ReloadDon't just close and reopen the app. A 'Developer Reload' specifically targets the Extension Host without killing your entire workspace. It is the fastest way to resolve 90% of temporary glitches. - Hit Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).- Type
Developer: Reload Windowand press Enter.Wait a few seconds for your extensions to initialize. If the command works now, you likely just had a hung process.
2. Inspect the Extension Host LogsIf the error persists, VS Code is likely trying to tell you exactly what’s wrong. You just need to know where to look.
- Open the Output panel by going to
View > Output.- Switch the dropdown menu (top right of the panel) from 'Tasks' to Extension Host.- Scroll for red text. You might seeModule not foundorActivation failed.For example, if you see an error about a missinggitbinary, you know the extension isn't broken—your system path is.
3. Reinstall to Clear Corrupted FilesUpdates occasionally fail mid-stream, leaving behind half-written files. A clean reinstall often fixes this.
- Open the Extensions view (
Ctrl+Shift+X).- Find the extension (e.g., 'C# Dev Kit' or 'ESLint') and click Uninstall.- Restart VS Code. This step is vital to ensure the old files are fully released.- Search for the extension and click Install.### 4. Wipe the VS Code CacheVS Code stores extension metadata in aCachedDatafolder to speed up startup. If this folder gets out of sync, it can point to files that no longer exist. Clearing it is safe; VS Code will simply rebuild it on the next launch. On Windows:
rmdir /s /q %APPDATA%\Code\CachedData
On macOS/Linux:
rm -rf ~/Library/Application\ Support/Code/CachedData # macOS
rm -rf ~/.config/Code/CachedData # Linux
5. For Extension Developers: Audit the ManifestIf you are building an extension and your own commands won't fire, check your package.json. You must register commands in two distinct places.
First, define the UI entry in contributes.commands:
"contributes": {
"commands": [
{
"command": "myExtension.helloWorld",
"title": "Hello World"
}
]
}
Second, tell VS Code when to load your code. Since version 1.74, VS Code is better at 'lazy loading,' but explicitly listing the command in activationEvents is the safest bet for debugging:
"activationEvents": [
"onCommand:myExtension.helloWorld"
]
Finally, verify that your main field points to the actual compiled script (e.g., ./out/extension.js) and not a missing source file.

