How to export path for vscode for your Mac OS
You need to first find the location of your installed VScode or install it. In case you have vs code installed on your machine, you can use this command : mdfind "kMDItemCFBundleIdentifier == 'com.microsoft.VSCode'"
Or to install vscode on your macOS using the terminal :
Install Homebrew (if not already installed):
If you don't have Homebrew installed on your macOS, you can install it by running the following command in your Terminal:
/bin/bash -c
"$(curl -fsSL
https://raw.githubusercontent.
Update Homebrew (optional):
It's a good practice to update Homebrew to the latest version before installing any packages. You can do this by running:
brew update
Install Visual Studio Code:
Now, you can use Homebrew to install Visual Studio Code with the following command:
brew install --cask visual-studio-code
Now Open your .zshrc file in a text editor. You can do this using the nano text editor or any other text editor you prefer:
nano ~/.zshrc
Find the line where you set your PATH. It may look something like this:
export
PATH="$PATH:/Applications/
Update the line to include the path to your Visual Studio Code installation:
export
PATH="$PATH:/Users/
Save the changes and exit the text editor. In nano, you can press Ctrl + O to save and Ctrl + X to exit.
After saving the changes, apply the updated .zshrc file by running the following command:
source ~/.zshrc
Now, the "code" command should work, and you should be able to launch Visual Studio Code by running code . from your terminal.
Please ensure that the path you've specified matches the actual location of the Visual Studio Code application on your system.
No comments:
Post a Comment