【发布时间】:2016-03-31 00:03:41
【问题描述】:
我有一个脚本hello,其内容如下:
#!/usr/bin/env node
console.log('hello there!');
当我使用./hello 运行它时,我得到以下输出:
$ ./hello
: No such file or directory
当我使用node ./hello 运行它时,我得到以下输出:
$ ./hello
hello there!
这是在 Ubuntu 16.04 上。
【问题讨论】:
-
我无法复制它。 (刚刚尝试,工作)
-
你运行 chmod +x hello 了吗?
-
@JamesMonger 你应该已经添加,你正在尝试哪个操作系统。
标签: javascript node.js linux shell ubuntu