The sublime-build
file snippet you posted above is trying to run the command specified in cmd
, which is "/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc"
, with $file
representing the name of the current file, which gets passed to the command.
Basically internally Sublime knows how to edit text and it knows how to execute external programs, so for any particular programming language (C, Python, JavaScript, etc) Sublime gives you the power to edit the source files that you’re working with, but you need to tell it what external program to use to run your code.
In my experience, Visual Studio is in many ways complex for even experienced users (I myself use it only when I have no other option, preferring to use Sublime instead). That’s just me though. Possibly Visual Studio Code is a little easier to get into, but I haven’t tried it so I can’t say for sure.
One way to do what you’re trying to do here would be to first install NodeJS on your system; during this process, if there is a question about adding node
to the system path, say yes. If it doesn’t ask, keep a note of where you installed it.
Then, you would want to replace the sample you have above with something like this instead:
{
"cmd": ["node", "$file"],
"selector": "source.js"
}
Assuming that the NodeJS installer set up the path for you automatically, this is all you need to do:

If that doesn’t work, you will likely get the same error as above, where Windows is telling you that it can’t find the program you’re trying to run. In that case you would also need to either add the location of NodeJS to the system path or modify the command to point to it directly (like C:/Program Files/nodejs/node
instead of node
, if it happens to be installed in that path). How you go about editing the path is different depending on the version of windows that you’re using.
It’s been a long time since I installed nodejs on this machine, but it looks like it did the work for me without my having to do it myself, so that may not be an issue.