Steps to Fix "VS Code Keeps Crashing on Startup" Error on Windows and macOS
If Visual Studio Code (VS Code) keeps crashing on startup, it can severely disrupt your workflow, and pinpointing the exact cause can be tricky.
This issue could be due to corrupted configuration files, problematic extensions, insufficient system resources, or even a faulty installation.
Here's a comprehensive guide to troubleshooting and resolving this issue: First, try launching VS Code in safe mode to disable extensions.
Open your terminal or command prompt and run the command code --disable-extensions
.
This starts VS Code with all extensions disabled, helping you determine whether an extension is causing the crash.
If VS Code launches without issues, the problem lies with one or more extensions.
Re-enable extensions one by one by going to the Extensions view (Ctrl+Shift+X
) and disabling or updating them to resolve the conflict.
If disabling extensions doesn’t solve the issue, the problem may be related to corrupted user settings.
VS Code stores its settings in the settings.json
file.
To reset your settings, you can navigate to the settings file and delete it, or open VS Code in the settings and choose to reset all settings to their default values.
If the problem persists, consider clearing your user profile.
On Windows, this is located in %AppData%\Code
, and on macOS, it’s in ~/Library/Application Support/Code
.
Deleting these files will reset VS Code to a fresh state.
Make sure to back up any important configuration files before doing this.
Another reason for crashes could be conflicts with system resources, such as insufficient RAM or CPU usage.
Close any unnecessary applications to free up system resources.
You can also check the Task Manager on Windows or Activity Monitor on macOS to see if any background processes are using excessive resources.
If VS Code still crashes, try uninstalling and reinstalling it.
Before reinstalling, uninstall VS Code completely and remove all related configuration files to ensure a clean installation.
To reinstall, download the latest version from the official website and follow the installation instructions.
In some cases, hardware acceleration might cause VS Code to crash.
Disable hardware acceleration by adding **disable-hardware-acceleration**: true
to the settings.json
file.
Finally, check for any system-wide issues such as corrupted system files or disk errors that could be affecting VS Code’s performance.
Use the built-in system repair tools to fix these issues.
By following these steps, you should be able to resolve the problem of VS Code crashing on startup and get back to coding without interruptions.