0

I am using visual studio code for develop my react application. I just wanted to open the project in the IDE using CLI, using "code ." command. Although it was perfectly working previously, now shows an error as below.

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

Can someone help me out to solve this matter?

2

2 Answers 2

4

This sounds like an issue with your environment variables rather than a problem with VS Code itself.

When you run the code command in Windows Command Prompt (cmd), Windows searches all commands on your path for one named code, and executes that command. VS Code installs a command with this name that opens the editor, normally located here on Windows:

C:\Program Files\Microsoft VS Code\bin

It may be that your path no longer contains this particular directory for some reason. You can edit your path directly to add it:

  1. From the Start menu, type "variables" and choose the option to "Edit environment variables for your account".
  2. Locate the PATH entry and edit it.
  3. Add the directory where the code command exists, e.g. C:\Program Files\Microsoft VS Code\bin.

The path editor may appear slightly different depending on what version of Windows you are running.

Sign up to request clarification or add additional context in comments.

Comments

0

My case was different rather than general solution for this question. I saw that the number of solutions which says the probelm exists with the environment valriables. In the new release it provides a setup file only.

Before downloading, there are certain properties to be selected.When I just redownloaded the set up and run it , it starts working perfectly.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.