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 (2)

Collapse
 
doreen_johnopara_4cde113 profile image
Doreen John-opara

It worked, thank you

Collapse
 
shy_tju24 profile image
shy_tju

thank you very much

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more