Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"code ." command is not working

this is the line i get when i did shell command in VS code

I get this error:

code . is not recognised as an external or internal command, operable program or batch file

moreover shell commands are not coming in my compiler VS code neither do setx path "%path%;C:\Program Files\Microsoft VS Code" is working in command prompt .

like image 207
nikhil sugandh Avatar asked May 04 '18 20:05

nikhil sugandh


3 Answers

I found it. In the "search" type environment variables then click on the "edit system environment variables".

Inside Environment variables->Path put C:\Users\{your_username}\AppData\Local\Programs\Microsoft VS Code\bin.

Go to the project folder and open the cmd with it typing in the location bar and then type code .

That will do.

like image 182
nikhil sugandh Avatar answered Oct 19 '22 00:10

nikhil sugandh


It looks as if you do not have the code program installed. You can open the Command Palette,

  • Mac: ShiftCmdP
  • Windows/Linux: ShiftCtrlP

And search "install command", which should return this as one of the options:

  • Shell Command: Install 'code' command in PATH

Run that, and it should install the code command, after which you should be able to use it.

like image 38
Dan Lowe Avatar answered Oct 18 '22 23:10

Dan Lowe


For Mac OS, You can paste this into your terminal, or in your .bashrc file (or whatever shell config file you are using) :

export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
like image 18
starryknight Avatar answered Oct 18 '22 23:10

starryknight