I just started learning programming and I installed Visual Studio Code to write javascript in.
I installed the Code Runner extension, to help me run my code.
Whenever I try to run my code it says:
/bin/sh: 1: node: not found
and nothing happens.
How do I fix this? I am trying to make hello world
appear, but it just says node not found.
I had the same issue with this (very useful) extension, but the solution is straight forward.
which node
The result will be similar to the following (I use nvm to manage my Node versions, yours might look a little different)
/home/my_username/.nvm/versions/node/v10.15.1/bin/node
Make a note of / copy this path.
In the search box at the top of this window, type:
Executor Map
Click the 'Edit in settings.json' link displayed under the first result.
Add the following to the end of the settings file, replacing the path with the one from step 1.
"code-runner.executorMap": {
"javascript": "/home/my_username/.nvm/versions/node/v10.15.1/bin/node"
}
The Extension should now work as planned (tested on Ubuntu 18.04)