zsh: command not found: code - Solved!

buchilazarus4

Nwafor Onyebuchi

Posted on February 11, 2024

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!

💖 💪 🙅 🚩
buchilazarus4
Nwafor Onyebuchi

Posted on February 11, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

zsh: command not found: code - Solved!