node and shebang : help executing via command line

node.jsPathShebang

node.js Problem Overview


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?

node.js Solutions


Solution 1 - node.js

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionaskingView Question on Stackoverflow
Solution 1 - node.jssecretformulaView Answer on Stackoverflow