如何在node.js中执行hello world javascript文件 [英] How to execute a hello world javascript file in node.js

查看:144
本文介绍了如何在node.js中执行hello world javascript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在位于以下位置的计算机上有 hello_world.js 文件 -

I have hello_world.js file located on my computer at the following location -

C:\Users\Ankur\Downloads\NodeJS\working

它有以下代码 -

console.log("Hellow World");

我在读初学者教程这里,它说我应该通过node.js执行我的javascript文件。现在我不知道该怎么办。我将如何做到这一点。

I was reading a beginners tutorial here and it says I should execute my javascript file through node.js. Now I have no idea what to do. How would I do this.

当我这样做...

When I do this ...

我什么都没有。
我应该做什么来成功地运行hello世界。没有一个教程似乎显示了需要做什么。

I get nothing. What should I be doing to run the hello world successfully. None of the tutorials seem to be showing what needs to be done.

我很新,所以这可能是对你们很明显的东西。 p>

I am very new to this so it is probably something that is very obvious to you guys.

推荐答案

使用 Node.js命令提示符,然后输入节点C:\Users\Ankur\Downloads\NodeJS\working\hello_world.js

这篇关于如何在node.js中执行hello world javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆