VS Code 'code' Command Not Found
Quick answer
Run Shell Command: Install 'code' command in PATH from the Command Palette, then restart the terminal. On macOS you can also add the app's bin folder to PATH in ~/.zprofile.
Most likely fix: Install via Command Palette
How to fix it
Try these in order — the most common fix is first.
1. Install via Command Palette
- Open VS Code and press Cmd+Shift+P
- Run Shell Command: Install 'code' command in PATH
- Restart your terminal and run code .
Did this fix it?2. Add to PATH manually (zsh)
- Append export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" to ~/.zprofile
- Open a new terminal
Did this fix it?3. Remove old aliases
- Delete any old code alias from ~/.zshrc or ~/.bash_profile
- Run the Shell Command install again
Did this fix it?
Symptoms
Typing code . gives 'command not found: code'.
Why it happens
- The shell command was never installed
- PATH not updated for the current terminal
- Old alias in shell profile
- App not in /Applications
This guide also covers
- code command not found mac
- vscode code . not working
- install code command in path
Still not working?
If VS Code keeps failing, you're not alone. See every VS Code problem users report or the alternatives people switch to.
Need a custom web app or internal tool? Our small team builds it, on your domain or hosted by us. Price agreed together.
Get a quote