visual studio code “Shell Command: Install 'co

2020-02-28 03:28发布

问题:

I just started with Angular. I installed angular/cli and added a project. Now I want to use visual studio code.

I Open the Command Palette (Ctrl + Shift + P) and type 'shell command' to find the Shell Command: Install 'code' command in PATH command.

But I get this message

"No commands matching"

Please help me. Why does not exist?

Not a duplicate.

Dupe target is for Mac while this question is on windows

回答1:

With Windows it is installed by default so you don't need to add path. Just run " code . " in cmd and it will work fine



回答2:

If in Visual Studio Code doesn't appear that option and the installation didn't add to the path directly, you can add the Visual Studio Code bin folder manually to the path and it starts to work.

Go to the Enviroment Variables and edit the Path user variable. Inside of it, add a new variable with the current bin path of your Visual Studio Code installation. Mine, for example, is "C:\Users\Inazio\AppData\Local\Programs\Microsoft VS Code\bin"

After that, you can start to use the code command in your OS



回答3:

I had this same problem. Long story short, I uninstalled VS Code, re-downloaded the installer package and ran that. Sure enough, one of the install screens has a checkbox option to add to the PATH variable and this option is unchecked by default.

Checked the box, finished the install, works fine.

Of course it's perfectly valid to modify the PATH variable after install, but I think it's important to clarify that (at least version 1.23.0) does not update PATH by default. Most of the threads I looked at says it does.



回答4:

it is already installed on Windows. You just have to make cmd path where the project created (e.g C:\WINDOWS\system32> cd C:\WINDOWS\system32\hello-world), then run the the comamnd "code ." like this (C:\Windows\System32\hello-world>code .)

I got this from VS Code documentation



回答5:

You don,t need to set the path .go to folder where your project is saved (most probably "C:\Users\your-username\project-name") and open command prompt and type "code ." and press enter. Visual Studio Code should open with your project files in it.



回答6:

I fixed this just adding "C:\Users\myUser\AppData\Local\Programs\Microsoft VS Code\Code.exe" (where myUser is your windows user) without "" to system path.

same effect than " Shell Command: Install ‘code’ command in PATH ".



回答7:

the path has been set automatically when installing VS.But i noticed a difference between "code." and "code ." Can you see the difference? The second has space in between the code and the dot. Try that.



回答8:

Visual Code already have internal terminal window

Use the Ctrl+` keyboard shortcut with the backtick character.

Its supports all Ubuntu terminal commands