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

Development Tools

Dave Harrison
seal-mask
.a{fill-rule:evenodd;}techdegree
Dave Harrison
Front End Web Development Techdegree Student 7,400 Points

Running JS Files in Console without Using the Browser

I am trying to do some of the JavaScript practice workshops. I would like to run all the files locally so have followed the instructions on Treehouse to install Node.js and NPM on my Mac. This is done and I can see they have both installed successfully.

I am now struggling to work out how I run .js files using this approach so I don't need to run them through the browser. Please, can anyone give me some pointers?

1 Answer

Hi Dave,

Do you have a modern development text editor like Sublime or Atom? I use Sublime and here is a link I found to run JS files in a console directly in Sublime with no need for a browser : https://pawelgrzybek.com/javascript-console-in-sublime-text/

I'm sure Atom has a similar plugin/package. Also you can try free online tools for JS experimentation like jsbin.com, jsfiddle.net or codepen.io. Also its not ideal but you can run js files in your command line by just calling "node filename.js" in the command line (terminal)