I am facing an issue in running environment variables in vs code terminal like npm, node(node –version) or any pip command. Node and python are installed and environement variables are set properly and commands are running in cmd but not running in vs code terminal and showing error that node is not recognized….
Tried reinstalling node, vs code still not working
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
I’m sorry to hear that you are facing issues running environment variables in VS Code terminal. Here are some steps that you can try:
Open VS Code and navigate to the terminal.
Type
echo $PATH
in the terminal and press enter. This will show you the current path of your system.Check if the path contains the location of your node installation. If not, you can add it by following these steps:
nano ~/.bashrc
and press enter.export PATH=$PATH:/path/to/node/bin
Ctrl+X
, thenY
, thenEnter
.If you are still facing issues, you can try adding environment variables in VS Code by following these steps:
Replace "windows" with your platform if you are using a different one.
If none of these steps work, you can try reinstalling VS Code or resetting your settings.
I hope this helps! Let me know if you have any other questions.
Source:
(1) Is there any way to set environment variables in Visual Studio Code …. Is there any way to set environment variables in Visual Studio Code?.
(2) Terminal Profiles in Visual Studio Code. https://code.visualstudio.com/docs/terminal/profiles.
(3) Python environments in VS Code – Visual Studio Code. https://code.visualstudio.com/docs/python/environments.
Run VS Code and press
Ctrl+Shift+P
and typeSelect Default Profile
then selectCommand Prompt
,finally Press Ctrl+`