If you have installed Microsoft Visual Studio Code on your Mac device and when you try to open it from the ZSH shell in your terminal and you get the error: zsh: command not found: code the reason is that you have not set the PATH for VS Code in your ZSH profile.
Solution:
- Open Zshrc profile file using - nano ~/.zshrc
- Now add the below line to the file,
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
- Now exit Nano, by pressing command + X and save changes.
- Apply the changes by tying source ~/.zshrc
- Now you should be able to open vs code using Zsh Shell in Mac Terminal.
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to zsh,
- Resolve - zsh: command not found: code
- zsh: command not found [fix] macOS
- How to fix: zsh: command not found: jupyter
- How to make ZSH as the default shell on Ubuntu
- How to Add New Entry to ZSH PATH
- Add Syntax Highlighting in Zsh Shell
- Fix: zsh: command not found: npm after installation (Node.js)
- Fix: zsh: command not found: mysql (Mac XAMPP)
- Ubuntu zsh: command not found: nano
- Fix: ZSH: cd: too many arguments (macOS)
- Fix - cd: no such file or directory: .zshrc
- How to reload zsh shell profile file?
- Fix zsh: permission denied: script.sh
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- macOS Ventura 13: The default interactive shell is now zsh
- How to Add Autocomplete in Mac Terminal
- Fix - zsh: command not found: pip
- ZSH: exec format error eclipse M1/M2 Mac
- Setting up Zsh Syntax Highlighting
- How to reload Zsh .zshrc Profile
- zsh: command not found: brew [fix]
- How to clear ZSH history of commands executed on Mac Terminal
- Fix - zsh: command not found: conda [macOS]
- Fix: cd: string not in pwd
More Posts:
- How to install pip with Python 3.X - Python
- Add Calendar to SharePoint Site (Office 365) - SharePoint
- Spring Boot JDBCTemplate Upsert Example (batch insert or update if exists) - Java
- Java JDBC Transition Management using PreparedStatement Examples - Java
- Use your iPhone microphone as a mic on macOS Ventura - MacOS
- Fix: Maven - Failed to execute goal - Compilation failure - Source/Target option 5 is no longer supported. Use 7 or later - Java
- Error code - 7: There's a more permanent way to sign in to Microsoft Teams - Teams
- SharePoint excel error - A problem occurred while connecting to the server. If the problem continues, contact your administrator. - SharePoint