Sublime Forum

Sublime Text 3 and Javascript builds

#1

Hi All,

Brand new to the forum, and JavaScript as well. I was looking to use the tool that a great deal of JavaScript developers use to assist me in learning the language. So far I’ve set up Sublime Text 3 with SublimeLinter and JSHint and those are working properly, but I can’t seem to figure out how to setup the build for it. Ultimately I’d like to have my code compiled here. I have tried many, many different variants of the same code to try and get it to work, but the end result is the same. I’m using console.log(“Hello World”); as the sample code, and it returns [Finished in 0.1s], without the build results.

The build I’m using is… (I use windows 7 64 bit).

Though I’ve tried many different variants of the same code for pretty much half of today. I’ve also tried the package JavaScript & CoffeeScript Build. I was wondering if anyone had a suggestion on how to get this functionality to work. I would greatly appreciate any help!

Thanks in advance,
Brandon

0 Likes

#2

This is what I have and it “works”.

{ "cmd": "node", "$file"], "file_regex": "^ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.js", "working_dir": "$file_path" ,"variants": { "cmd": "node.exe", "$file"], "name": "Run" ,"working_dir": "$file_path" } ] }

“works”, meaning, I get the expected output in the “Build Results” window, e.g.
with Ctrl+B:
Hello World
[Finished in 0.2s]

with Ctrl+Shift+B:
Hello World
[Finished in 0.3s]

Make sure “Tools>Build System” is set to ‘JavaScript’.

0 Likes

#3

Hey warHorse,

Thanks for the response! I know that works… it gives me the run option with your build whereas other codes I’ve tried usually keep that greyed out. I still can’t see the results when I run it though. It still just gives me [Finished in 0.1s]. Are there any other options that I need to tag? Like save on build for example? Maybe it doesn’t work when I have sublimeLinter running?

EDIT:
Interesting… It actually does show the build results, but only when the JavaScript that I’m running fails. Also, when I use this, shouldn’t I see node.exe running in the background?

This is the error I’m seeing.

Thanks,

B

0 Likes

#4

Hm. That’s pretty weird man. I dunno. Kinda stumped here. I don’t run any plugins so I don’t know what effect those would have…
Wish I had a better suggestion for you.
Good luck.

(If you find out what it is, let us know. :wink:

0 Likes