if you are using macOS, try to follow this step
if you write the code to export PATH in ~/.bash_profile
then don't miss the Step 1
Step 1:
.bash_profile
is loaded when your terminal is an open, check on your ~/.bashrc
or ~/.zshrc
(if you are using zsh), is there any code similar source ~/.bash_profile
or not?. if not you can add manually with adding code source ~/.bash_profile
in there.bash_profile
> export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
if it not in there, add that code into itSep 2:
"Visual Studio Code.app"
is in the right place > "/Applications"
or "/Users/$(whoami)/Applications"
rm -rf /usr/local/bin/code
CMD+Shift+P
and then select "Shell Command: Instal "code" command in PATH"
code -v
, it should be work