VS Code terminal doesn't recognize PATH variables

Viewed 13761

I added a directory to my PATH but the terminal in my VS Code doesn't recognize a command(exe) that I'm trying to run from that directory. The terminal uses cmd not power shell. What am I missing?

5 Answers

For me, a simple restart of VSC did the trick.

If your VS Code terminal shows "Session Restored" after restarting, then it may still be using the variables from before you rebooted! If this happens, close and re-open the vscode window, or kill and restart the terminal tab.

Clicking the bin/trash icon on the terminal to properly kill it and then CTRL + ' to open a new terminal works best. No need to close the app or shut down your PC.

enter image description here

I had some files remaining in the folder 'c:\Program Files\nodejs', deleted the folder and it all worked.

Related