Troubleshooting your Command Code
Common issues and solutions for Command Code. If you can't find what you're looking for here, check the FAQs or Error Codes pages.
Problem: Running cmd prints:
On versions of Command Code before this check existed, the same cause showed up as a crash instead:
Command Code requires Node.js 22 or newer (the current LTS). Node 22 is where APIs the CLI depends on landed, so on Node 20 and below it cannot start.
Solution:
-
Check what you're running:
-
If it's below
v22, upgrade using one of the options in Upgrading Node.js below. -
Reinstall Command Code so its
cmdbinary is linked against the new Node:This step matters. Global binaries are linked to the Node version that installed them, so skipping it can leave
cmdpointing at your old Node and failing with the same message. -
Confirm:
Pick whichever matches your setup. If you don't already use a version manager, n is the quickest way to get onto the LTS.
n (simplest, macOS/Linux):
If your global npm prefix is a root-owned directory, both commands need sudo.
nvm (macOS/Linux):
fnm (fast, cross-platform):
Volta (cross-platform, pins per project):
asdf (multi-language version manager):
Homebrew (macOS):
Windows (winget, Chocolatey, or a version manager):
nvm on Windows means nvm-windows, which is a different tool from the macOS/Linux nvm; its commands are similar but not identical. fnm also works well on Windows. See the Windows guide for the rest of the Windows setup.
Linux via NodeSource (system-wide, no version manager):
Official installer / archives: download the LTS build for your platform from nodejs.org.
After upgrading by any route, reinstall Command Code (npm i -g command-code) so cmd relinks to the new Node.
Problem: Running cmd returns "command not found"
Solution:
-
Verify the install succeeded:
-
Ensure your global
node_modules/.binis in yourPATH:The binary directory is
<prefix>/bin. Add that to yourPATHif it's not already there. -
Restart your terminal or source your shell profile: