PDA

View Full Version : [SOLVED] Node.js hello world



tumelo
December 8th, 2015, 06:40 PM
I'm on LXLE.

I ran "sudo apt-get install node"
And then made a helloworld.js file which contains "console.log("hello world");
then I ran "node helloworld.js"

but nothing happened. I thought the hello world program would be that simple. Am I missing something?

spjackson
December 8th, 2015, 07:05 PM
I ran "sudo apt-get install node"

Really? The package for node.js is called "nodejs". There is a package called "node" but that is an entirely different thing.

tumelo
December 8th, 2015, 07:27 PM
I figured it out. Apparently the package is called nodejs, not node.

So you have to run "sudo apt-get install nodejs"

and then run the program with "nodejs helloworld.js" instead of "node helloworld.js"

tumelo
December 8th, 2015, 07:28 PM
Sorry didn't read your response until after I figured it out and posted, but Thanks spjackson