This article will help you how to install Visual Studio Code on macOS operating system using Homebrew.
1. Visual Studio Prerequisites.
Homebrew is a popular package management tools used for installing most open-source software like Node.
To Install Homebrew on macOS, open a terminal and run the following command below.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The installation process will prompt for the password. Just enter your password where required to complete the Homebrew installation. The process will take some time.
Once the installation completed, you can check the version by running the command below.
brew --version
Homebrew 3.5.2-2-gedea67f
Homebrew/homebrew-core (no Git repository)
You may also run the below command to ensure everything is configured correctly. below command will show the instructions for correcting any issues.
james@JamesEduard repos % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: A newer Command Line Tools release is available.
Update them from Software Update in System Preferences or run:
softwareupdate --all --install --force
If that doesn't show you any updates, run:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Alternatively, manually download them from:
https://developer.apple.com/download/all/.
You should download the Command Line Tools for Xcode 13.4.
Warning: Homebrew/homebrew-core was not tapped properly! Run:
rm -rf "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
git -C $(brew --repo homebrew/core) checkout
To upgrade Homebrew, execute the command below in terminal prompt.
cd "$(brew --repo)" git fetch && git reset --hard origin/master && brew update
To uninstall Homebrew, execute the command below in a terminal.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
2. Install Visual Studio Code on macOS
First, fetch the latest version of homebrew and formula. Then tap the Caskroom/Cask repository from Github. After that search for the visual-studio-code package.
brew update
brew tap homebrew/cask
brew search visual-studio-code --cask
To install Visual Studio Code, execute the following command in terminal.
brew install visual-studio-code
Output: Wait until the installation complete.
==> Downloading https://update.code.visualstudio.com/1.68.0/darwin/stable
Already downloaded: /Users/jameseduardandaya/Library/Caches/Homebrew/downloads/50e5eb910a4768c05aff2cba09a255aba3cf9449a1383930c4b4e02bbecbdcc3--VSCode-darwin.zip
==> Installing Cask visual-studio-code
==> Moving App 'Visual Studio Code.app' to '/Applications/Visual Studio Code.app'
==> Linking Binary 'code' to '/usr/local/bin/code'
🍺 visual-studio-code was successfully installed!
3. After completing the installation of Visual Studio Code, you can launch it on your macOS system and you can add the required extensions or plugins needed for your application or development.
3. Installation done , below is a recommended plugins or extension for vscode
- zsh
- git
- syntax highligter
- Git Lens
- Vim
- YAML
- Azure Tools
- Terraform
- .NET