DEV Community

Teerasak Vichadee
Teerasak Vichadee

Posted on • Updated on

Install vscode on OSX via brew

| updated to latest brew version (thanks: @eloisetaylor5693 )

Already have brew, then go

$ brew install --cask visual-studio-code
Enter fullscreen mode Exit fullscreen mode

If doesn't have brew before, run this first

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Success ? check version and run :D

$ code --version 
$ code {your-project-folder}
Enter fullscreen mode Exit fullscreen mode

Top comments (5)

Collapse
 
eloisetaylor5693 profile image
eloisetaylor5693

Following the brew instructions noted in your post, I ran this brew cask install visual-studio-code, but got an error: Error: Unknown command: cask

After removing cask it worked

Collapse
 
eloisetaylor5693 profile image
eloisetaylor5693

seems like newer version of homebrew uses --cask instead, so now looks like this:

brew install --cask visual-studio-code

Collapse
 
ilumin profile image
Teerasak Vichadee

Thanks mate, I'll update my post too!

Collapse
 
tik9 profile image
Timo Körner

Why I need --cask? I installed without the flag and it works.

Collapse
 
xtrasmal profile image
Xander

Cask offers a way to manage the installation of graphical applications.

Brew without the --cask would install headless versions of those applications(like Docker for example) or would install the commandline version of it. It could also mean it install the application, but keeps it in the homebrew installation folder.

Installing all your applications through --cask allow you to better manage your system using homebrew only.

Homebrew offers the brew bundle dump command, which dumps all the things you installed on your machine through homebrew. It would create a file in your home directory called Brewfile, which you can use to easy recover your software using brew bundle install.