DEV Community

Nwafor Onyebuchi
Nwafor Onyebuchi

Posted on

zsh: command not found: code - Solved!

There are so many ways to open a project in VS code. My favorite is to navigate to the project directory from my terminal and invoke VS code on the directory by simply typing code .

However, sometimes the magic wand doesn't work, especially after a new installation of VS Code. It would instead just spit out zsh: command not found: code in the terminal. So how do you solve this?

  1. Open your VS code
  2. Press Command + Shift + P. This will open the command palette.
  3. Then search for shell command.
  4. Select Install 'code' command in PATH. You might be prompted to type in your password. That's it.
  5. Head over to your terminal and type code ..

That's it! Happy coding!

Top comments (0)