I would like to use VSCode to run a program that is on my Windows computer c:\test.js
using a version of node.js
which is in a network folder (\\servername\folder\node.exe
).
I do not want to install node.js
, but just refer to the files on the network folder.
I set up the file launch.json
below:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${file}",
"runtimeExecutable": "\\\\servername\\folder\\node.exe"
}
]
}
When I run test.js
, VSCode gives an error Can't find Node.js binary \\servername\folder\node.exe
.
I can successfully run the program if I copy node.exe
to my c-drive (c:\node.exe
), and change launch.json
to
"runtimeExecutable": "c:\\node.exe"
It also works to set the PATH
to the network folder per How do I add environment variables to launch.json in VSCode. :
"env": {"PATH": "\\\\servername\\folder"},
//"runtimeExecutable": "\\\\servername\\folder\\node.exe"
I checked to ensure the path to node.exe
on the network is correct.
Why can't VSCode find this file on the network, and what can I do to fix this?