With a downloaded and installed version of Visual Studio Code 1.2.1, and a 64bit version of node.exe msi placed in my working directory (I am assuming that is correct), how
i resolved this problem after disable ESLint
extention.
If you are under Linux and using .nvm and node/npm/yarn are working in regular terminal but it doesn't work in VSCode - it's because .nvm add node to $PATH only when you open terminal window (~/.bashrc file), but VSCode's terminal is /bin/sh by default. Just press Ctrl+Shift+P and select "Terminal: Select default shell". In my case, it was /usr/bin/tmux for Kali Linux.
Do not launch the VS code from the start menu separately. Use
$Code .
command to launch VS code. Now, create your file with the extension .js and Start debugging (F5) it. It will be executed.
Otherwise, restart your system and follow the same process.
I also encountered this issue. Did the following and it got fixed.
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
I use /bin/zsh
, and I changed vscode to do the same, but somehow vscode still use the path from /bin/bash
. So I created a .bash_profile file with node location in the path.
Simply run in terminal:
echo "PATH=$PATH
export \$PATH" >> ~/.bash_profile
Restart vscode, and it will work.
For me, the node
binary is in PATH
and I can run it from the terminal (iTerm or Terminal), and the Terminal apps are set to use zsh
If you are on a Mac, with iTerm and Zsh, please use the following VSCode settings for Node to work.
After this change, you can get rid of this line from your launch.json
config file. (the debug settings in VSCode)
"runtimeExecutable": "/usr/local/bin/node"
If this doesn't work, make sure you choose the default shell as zsh
. To do this,
Open the command palette using Cmd+Shift+P
Look for the Terminal: Select Default Shell
command
Select zsh
from the options