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