N
N
Nikola_y2014-11-09 10:08:47
Node.js
Nikola_y, 2014-11-09 10:08:47

What is the problem with Node.js?

here is such a stupid problem
I downloaded node.js (under Windows, I tried both 32bit and 64bit)
created a file helloworld.js
In it
console.log("Hello World");
I run node.exe , I
write
node helloworld.js,
but it doesn’t output anything except
...
And then I started to go through the lessons, but at the very first I blunted
Help and thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Jeiwan, 2014-11-09
@Jeiwan

You need to launch the console (I don’t remember what it’s called in Windows, but it’s better to use not the standard one, but PowerShell), go to the folder with the helloworld.js file and run node.exe helloworld.js. This command runs the file passed to it in node.js.
When you run node.exe, a js interpreter is launched that only accepts js code. node helloworld.jsIt makes no sense to write in it . node helloworld.js(this is generally a command from unix systems, in Windows instead of node there should be node.exe) you need to run it from the console.

T
Timur Shemsedinov, 2014-11-09
@MarcusAurelius

After starting node and receiving an invitation, you can write JavaScript like this: require('./helloworld');And from the command line it is launched via node helloworld, writing with extensions node.exe helloworld.js, as advised above, is not necessary. Run the command line in Windows by pressing Win + R and enter cmdand press enter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question