VSCode编译完成后出现冻结问题求助
yarn run watch Hey there, I totally get how confusing this must be when you're compiling VS Code source code for the first time—you run yarn run watch, it finishes with Finished Compilation with 0 errors, but then the console just hangs, even switching terminals doesn't fix it. Let's break this down and figure out what's going on:
First, Check if This Is Actually "Stuck" or Just Expected Behavior
Let's start with the basics: the yarn run watch command is designed to stay running indefinitely after compilation. Its core job is to monitor your source files for changes, and automatically recompile whenever you edit any code. So if your console is just sitting at the Finished Compilation with 0 errors line without exiting, that might be totally normal!
Test this by making a tiny change to any source file (like adding a random comment somewhere) and check if the console springs back to life with a new compilation process. If it does, you're all set—this is exactly what the command is supposed to do.
If It's Actually Unresponsive (No Recompilation on File Changes)
If modifying files doesn't trigger any new activity in the console, then we have a real issue to fix. Try these steps:
- Clear caches and restart:
Stop the currentwatchprocess first, then run these commands to clear build caches:
After that, re-runyarn cache clean rm -rf node_modules/.cacheyarn run watchand see if the console behaves normally. - Check system resource usage:
Compiling VS Code is resource-heavy—open your task manager (Windows) or activity monitor (Mac) to check if your CPU or memory is maxed out. If so, close other resource-hungry apps and try again. - Verify your Node.js version:
VS Code has specific Node.js version requirements. Check the README in the VS Code source repo for the recommended version, then use a version manager likenvmto switch to that version before re-compiling. - Simplify your terminal setup:
Sometimes terminal plugins, custom themes, or special settings can interfere with long-running processes. Try switching to a plain, default terminal (no plugins, no custom config) and run the command again.
Verify the Compiled Code Works
Regardless of the console state, you can confirm if the compilation was successful by launching VS Code in a separate terminal:
yarn run code
If the VS Code app opens up without issues, your compilation was a success—any "stuck" console is just the watch command doing its job of waiting for file changes.
内容的提问来源于stack exchange,提问作者Long Nguyen

