Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Giving Information to Functions

Ian Mackenzie
Ian Mackenzie
11,062 Points

How do I get Sublime Text to run JavaScript code inside the editor?

I use the latest stable version build 3083. How can I run JavaScript code inside this editor. I've tried a couple of suggestions off the net and both have not worked. I have Node.js and NPM installed.

Konrad Pilch
Konrad Pilch
2,435 Points

Hi Ian Mackenzie !

It;s been 10months since then, could i ask you what have you learned and hows your life about this thing?

7 Answers

Ian Mackenzie
Ian Mackenzie
11,062 Points

To get this up and running I followed the information on wikiHow http://www.wikihow.com/Create-a-Javascript-Console-in-Sublime-Text and method one as I use a Mac.

Carlos Casciano
Carlos Casciano
10,459 Points

worked perfectly here! ty!

Craig Garrity
Craig Garrity
23,692 Points

Hi, know this is an old question but if anyone is still interested in setting this up, there is a good guide here; javascript-console-in-sublime-text

You can't run JS inside sublime unless you have an extension which allows that sort of thing. SublimeText is build in python so potentially you can run python code from directly within the editor, but JS needs a JavaScript interpreter (like v8 or blink, etc).

I found someone who compiled the V8 engine for sublime. Maybe that's what you're looking for?

Ian Mackenzie
Ian Mackenzie
11,062 Points

Yes Jonathan, I ended up using the command-line Javascript runner method after installing Node.js

Working fine now but thanks for your reply.

Konrad Pilch
Konrad Pilch
2,435 Points

Save ht efile as .js

Ian Mackenzie
Ian Mackenzie
11,062 Points

The file has a .js extension.

Konrad Pilch
Konrad Pilch
2,435 Points

So what exactly are you trying to do ?

Ian Mackenzie
Ian Mackenzie
11,062 Points

trying to write some code to the console inside of sublime. Or should I say output the code.

Konrad Pilch
Konrad Pilch
2,435 Points

aa , sorry , im not familiar with that .But there is something in developement tools i think that go throw this kind of stuff maybe? if i remember well not sure but you might check out there quickly and maybe there will be something .