VS Code 'code' Command Not Found

Share
Fixed in latest version macOS Updated November 13, 2026Based on 2 user reportsHow we research

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. 1. Install via Command Palette

    1. Open VS Code and press Cmd+Shift+P
    2. Run Shell Command: Install 'code' command in PATH
    3. Restart your terminal and run code .
    Did this fix it?
  2. 2. Add to PATH manually (zsh)

    1. Append export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin" to ~/.zprofile
    2. Open a new terminal
    Did this fix it?
  3. 3. Remove old aliases

    1. Delete any old code alias from ~/.zshrc or ~/.bash_profile
    2. 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
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other VS Code errors

All 12 VS Code errors and fixes →