Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command 'code' is not available in 'snap/bin/code'

I am new to Ubuntu and I am using xfce desktop environment. I was using this vscode docs to install vscode in ubuntu. I ran this command:

sudo snap install --classic code # or code-insiders 

which executed successfully. The documentation does not say how to open VSCODE. I am assuming there is no way to open it using GUI as VS Code did not appear when I tried to search for it using the search application feature?

I searched on stack overflow and found that I should be able to run vs code at this point by running code in the terminal.

But when I do so I get:

Command 'code' is available in '/snap/bin/code' The command could not be located because '/snap/bin' is not included in the PATH environment variable. code: command not found

echo $PATH gives me:

/sbin:/bin:/usr/bin:/usr/local/bin

I tried to browse to snap/bin folder and open terminal there but the terminal does not open.

like image 720
namko Avatar asked Sep 11 '25 02:09

namko


1 Answers

  1. Open the .bashrc (or .zshrc) file in your home directory (for example, /home/your-user-name/.bashrc) in a text editor.
  2. Add export PATH="/snap/bin:$PATH" to the last line of the file.
  3. Save the .bashrc/.zshrc file.
  4. Restart your terminal.
like image 199
Denny Biasiolli Avatar answered Sep 13 '25 16:09

Denny Biasiolli