In my case I had this issue because I was logged in as Administrator instead of my usual user id. Environment variable for path did not include location of VSCode for Administrator user. Updating the path variable fixed the issue.