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

IntelliJ中刷新SBT项目失败及idea-shell命令无效问题求助

Fixing the "invalid command: idea-shell" Error When Refreshing SBT Projects in IntelliJ

Hey there, let's tackle that frustrating SBT refresh issue you're facing—glad to hear you're not the only one hitting this! That "invalid command: idea-shell" error pops up because idea-shell was a legacy command used by older versions of the IntelliJ Scala plugin, and it's no longer supported by newer SBT versions or updated plugins.

Here are the step-by-step fixes to get your project refreshing smoothly again:

  • Update your IntelliJ Scala Plugin
    Open IntelliJ's Settings (Preferences if you're on a Mac), head to the Plugins section, search for the Scala plugin. If there's an update available, install it and restart IntelliJ. Newer plugin versions use updated SBT commands that don't rely on the deprecated idea-shell.

  • Upgrade your project's SBT version
    Check your project's build.sbt or project/build.properties file. If you're using an older SBT version (pre-1.x maybe?), upgrade it to a stable recent release (like the latest 1.x version). Newer SBT builds have dropped support for idea-shell, so aligning your version with the plugin will fix the command mismatch.

  • Wipe caches and restart
    Sometimes stale cache files cause weird misalignments:

    1. Close IntelliJ completely.
    2. Delete the .sbt and .idea folders in your project directory (make sure to back up any custom configs you've added first!).
    3. Reopen IntelliJ, go to File > Invalidate Caches..., check all the available options, then click "Invalidate and Restart".
  • Re-import your project from scratch
    After restarting, don't just hit the refresh button. Instead, go to File > New > Project from Existing Sources..., select your project's root directory, and follow the prompts to re-import it as an SBT project. This forces IntelliJ to generate fresh, compatible configuration files.

A quick sanity check: Try running sbt shell directly in your terminal. If that works without errors, the issue is definitely with IntelliJ's plugin/cache setup, not your project's SBT configuration.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.25 03:28:50