Node 和 shebang: 通过命令行帮助执行

我的节点安装在:

/usr/local/bin/node

我还加上了一句话:

#!/usr/local/bin/node

到文件的顶部,并给予我的节点应用程序文件755的权限,但是当我尝试运行:

> ./my-app

我听到了老话:

-bash: ./my-app: No such file or directory

我做错了什么?

37682 次浏览

The node shebang is:

#!/usr/bin/env node

Not all systems place node in the same location, its possible that you have the location incorrectly. This will find them all.

Source

Also