You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

意外重启后IntelliJ IDEA出现异常问题求助

Fixes for IntelliJ IDEA Issues After Unexpected System Reboot (Angular CLI + Spring Boot Maven Projects)

Hey there, sorry to hear you ran into these frustrating headaches after an unexpected system reboot—those sudden crashes can really mess up IDE state, especially on older IntelliJ versions like 2017.x and 2018.1.1. Let’s break down targeted fixes for each of your issues:

Angular CLI Project Problems

1. Main IntelliJ Module No Longer Recognized

When the IDE’s module metadata gets corrupted mid-session, here’s how to reset it:

  • Close the project completely in IntelliJ (don’t just minimize it).
  • Navigate to your Angular project’s root directory and delete the .idea folder—this stores IDE-specific configs that are likely broken.
  • Also delete any *.iml files in the project root and subfolders; these are module-specific metadata files that can get corrupted after a crash.
  • Reopen the project in IntelliJ. It will re-scan the project and rebuild the module structure from scratch. When prompted, make sure to select the option to recognize it as an Angular CLI project.

2. ng serve Doesn’t Detect File Changes, Requires CTRL+C After IDE Restart

This usually stems from corrupted IDE caches or misconfigured file watchers. Try these steps in order:

Fix A: Invalidate and Restart IntelliJ Caches

  • Go to File > Invalidate Caches / Restart...
  • Select Invalidate and Restart—this clears out corrupted cache files that might be blocking file change detection.

Fix B: Verify Angular CLI File Watcher

  • After restarting, head to Settings > Tools > File Watchers (on macOS, it’s IntelliJ IDEA > Preferences > Tools > File Watchers).
  • Ensure the Angular CLI watcher is present and enabled. If it’s missing, click the + button, select Angular CLI from the list, and use the default auto-detected settings for your project’s ng executable.

Fix C: Force Polling with ng serve

  • As a temporary workaround (to confirm the issue is with file watching), run ng serve --poll 1000—this forces Angular CLI to poll for file changes every 1000ms. If this works, the root cause is likely a miscommunication between IntelliJ’s file watcher and Angular CLI.

Spring Boot Maven Project Fixes (Common Post-Reboot Issues)

Since you mentioned two Spring Boot Maven projects, here are the most reliable fixes for issues that crop up after an unexpected reboot:

  • Reimport All Maven Projects: Open the Maven tool window, then click the circular "Reimport All Maven Projects" icon. This refreshes dependencies and syncs the module structure, which often gets out of sync after a crash.
  • Delete Corrupted Build Artifacts: For each Spring Boot project, delete the target folder. Leftover incomplete build files from the interrupted session can cause runtime or build errors—Maven will rebuild this folder automatically on your next build.
  • Refresh Run/Debug Configurations: If your Spring Boot run configs aren’t working, go to Run > Edit Configurations, delete any corrupted entries, and recreate them by selecting Spring Boot and choosing the correct main class for each project.

内容的提问来源于stack exchange,提问作者Emanuele Cipolla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:44:10