node and shebang : help executing via command line

自作多情 提交于 2019-11-27 11:03:05

问题


My node installation is at:

/usr/local/bin/node

and I've added the shebang:

#!/usr/local/bin/node

to the top of the file and given my node app file the permissions 755, but when I try to run:

> ./my-app

I get the old:

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

What am I doing wrong?


回答1:


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



来源:https://stackoverflow.com/questions/24253027/node-and-shebang-help-executing-via-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!