2
这是我的文件test.js包含:从命令行调用脚本的NodeJS不起作用
console.log("Hello Stackoverflow");
这是发生了什么,当我尝试运行它:
$ ls
test.js
$ node test.js
$ node test
$ node "test"
$ node "test.js"
$ node --debug test.js
debugger listening on port 5858
$ node --debug test
debugger listening on port 5858
$
注意它永远不会工作:(我可以运行只是“节点”,并逐行评估JavaScript语句,但每当我尝试运行脚本如上所述,它不起作用。 nodejs。
我不是在Mac上,但我无法重现此(Win 7 x64,节点v0.10.16)。 – 2013-08-23 19:44:42
奇怪..它在这里工作得很好 – hexist
'node test'不会返回错误,这很奇怪。也许'节点'是别名的东西。 – 2013-08-23 22:18:43