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 Introducing the Practice

Tuan Phan
Tuan Phan
10,825 Points

My node let_const.js does not work at all.

My node let_const.js does not work at all.

I tried to reopen it, tried with multi browser. Still did not work. Anyone knows how to fix it :(

p/s: I only have problems towards command named "node let_const.js" as I want to know how to use it/what is wrong with mine.

4 Answers

Adam Beer
Adam Beer
11,314 Points

Please use treehouse workspace at the beginning or do an basic index.html file like this:

<!DOCTYPE HTML>
<html>
<head>
  <title>Practice Let and Const in JavaScript</title>
</head>
<body>
<script src="let_const.js"></script>
</body>
</html>
Tuan Phan
Tuan Phan
10,825 Points

I knew how to make it run offline with IDE and browsers.

And I do use the workspace. It just do not work, still. I had same problems occasionally while running command "node someFileName.js" That is why I am curious what is wrong and how could I fix it.

Josef Aidt
Josef Aidt
7,722 Points

It should work if you're running it locally using Node, but keep in mind anything you want outputted to the console you'll need to use console.log

Tuan Phan
Tuan Phan
10,825 Points

Thanks for your answer but I do not have problems with the file or the console.

The only concern I have is the "node let_const.js" do not work on my workspace. I am looking what is wrong and how to fix it.

Josef Aidt
Josef Aidt
7,722 Points

I'd have to direct your issue to TeamTreeHouse's technical support as that is something the community cannot answer for you, unfortunately. Also, take a look at Adam Beer's response regarding using the workspace at the beginning of that course segment.

Tuan Phan
Tuan Phan
10,825 Points

Sorry, there is nothing wrong with the Node command but my code. Thank guys for your all advices.