shell_cmd": "taskkill /F /IM node.exe & node $file not working with Sublime Text 3 on Windows 7
The line in sublime-build "shell_cmd": "taskkill /F /IM node.exe & node $file" is causing an error ERROR: The process "node.exe" not found..
If I comment out the taskkill line the error disappears.
I've added "node_command": "C:\\Program Files\\nodejs\\node.exe" in user sublime-settings.
How can I fix this??
{
"cmd": ["node", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.js",
"shell": true,
"encoding": "cp1252",
"windows":
{
"shell_cmd": "taskkill /F /IM node.exe & node $file"
},
"linux":
{
"shell_cmd": "killall node; /usr/bin/env node $file"
},
"osx":
{
"shell_cmd": "killall node; /usr/bin/env node $file"
}
}
I just had this problem again and found this question from a Google search that I'd forgot I had written lol.
I fixed this issue by adding the path to node.exe in the nodejs.sublime-build file.
"windows":
{
"shell_cmd": "taskkill /F /IM C:/Program\ Files/nodejs/node.exe & node $file"
The backslash is to escape the space. It bugs out without the backslash.
I don't understand why sublime text nodejs.sublime-build can't find node.exe because it's in my PATH and it works from the command line. Anyway, that fixes the problem.