Q:

Nodejs build sublime-text2

I am trying to use sublime-text 2, have installed Nodejs for Windows, the Nodejs plugin through package control and I get the following error:

ERROR: The process "node.exe" not found.
The filename, directory name, or volume label syntax is incorrect.
[Finished in 0.1s with exit code 1]

I have setup as my user environment variable a NODE_PATH: C:\Program Files\nodejs\node.exe
There is in my System variables PATH: C:\Program Files\nodejs\
My Nodejs.sublime-settings is set-up as follows:
{
  // save before running commands
  "save_first": true,
  // if present, use this command instead of plain "node"
  // e.g. "/usr/bin/node" or "C:\bin\node.exe"
  "node_command": "C:/Program Files/nodejs/node.exe",
  // Same for NPM command
  "npm_command": false,
  // as 'NODE_PATH' environment variable for node runtime
  "node_path": "C:/Program Files/nodejs/node.exe",

  "expert_mode": false,

  "ouput_to_new_tab": false
}

My Nodejs.sublime-build is set-up as follows:
{
  "cmd": ["C:/Program Files/nodejs/node.exe", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
  "encoding": "cp1252",
  "windows":
    {
        "cmd": ["taskkill /F /IM node.exe & node", "$file"]
    },
  "linux":
    {
        "cmd": ["killall node; node", "$file"]
    }
}

As a side note, I'm using JSHint which uses Nodejs using the same path (namely "C:/Program Files/nodejs/node.exe") and JSHint works!
Any idea why I can't use Nodejs build system?
Thx

A:

Try setting your build system just to the following for the time being:
{
  "cmd": ["C:/Program Files/nodejs/node.exe", "$file"],
  "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  "selector": "source.js",
  "shell":true,
}

Because you have a Windows-specific section, it's running that instead of the "cmd" on the first line of the build system. I suspect there's some sort of issue with the taskkill command.
If this does work, and you feel the need to have the taskkill section back in there, try restructuring it like so:
"windows":
    {
        "cmd": ["taskkill", "/F", "/IM", "node.exe", "&", "C:/Program Files/nodejs/node.exe", "$file"],
        "shell": true
    }

Obviously, you don't need the linux section in there at all. I'm not too sure about the syntax on windows, you may need to have two ampersands && there instead of one - I know that's the case on OS X and Linux systems.
Good luck!

