“code .” command is not working

后端 未结 6 2111
难免孤独
难免孤独 2021-01-05 05:06

I get this error:

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

相关标签:
6条回答
  • 2021-01-05 05:13

    After installation, you need to restart your computer to make the PATH changes effective. Post restart, the command worked for me.

    0 讨论(0)
  • 2021-01-05 05:23

    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.

    0 讨论(0)
  • 2021-01-05 05:24

    in windows problem is with insiders version of VSC. You can use 'code-insiders .' command or make a copy of 'code-insiders.cmd' file as 'code.cmd' inside folder with code-insider (use 'path' command to see where your VSC is installed)

    0 讨论(0)
  • 2021-01-05 05:36

    make sure you run the command in C folder

    Then click window key + R and type rundll32.exe sysdm.cpl,EditEnvironmentVariables then enter . It will open Environment Variables edit Path variable . Check whether you have C:\Users\{pc name}\AppData\Local\Programs\Microsoft VS Code\bin if not add it and run code -v in C folder cmd

    This worked for me !

    0 讨论(0)
  • 2021-01-05 05:36

    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.

    0 讨论(0)
  • 2021-01-05 05:38

    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"
    
    0 讨论(0)
提交回复
热议问题