0

I am using Visual Studio Code, but I can't run the option "install code command in path", because this command does not appear when I type Shift + Ctrl + P. I am using Windows 10 and the latest version of Visual Studio Code.

I tried many steps to solve my problem, but with no success. Here is what I did:

  1. Reinstalled Visual Studio Code (the latest version), and checked the option to add to the PATH variable. Didn't work.
  2. Opened Environment Variables and edited the Path user variable, restarted the computer. Didn't work.
  3. Opened command prompt and typed code .. Didn't work.

What should I do next?

2

2 Answers 2

1

When using Visual Studio Code and:

  1. code . does not work
  2. "install code command in path" doesn't exist in Visual Studio Code

Manually add VS Code to your path using the following command in Git:

cat << EOF >> ~/.bash_profile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF

Start a new terminal to pick up your .bash_profile changes.

Note: The leading slash \ is required to prevent $PATH from expanding during the concatenation. Remove the leading slash if you want to run the export command directly in a terminal.

Note: Since zsh became the default shell in macOS Catalina, run the following commands to add VS Code to your path:

cat << EOF >> ~/.zprofile
# Add Visual Studio Code (code)
export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
EOF
Sign up to request clarification or add additional context in comments.

Comments

-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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.