Wednesday 20 February 2019

Question about interpreter location in shebang

Currently building a CLI and I have a question about the shebang line at the top -​what does env node mean in /usr/bin/env node and how is it any different from /usr/local/bin/node?​I know the point of the shebang is to point the file (once made into an executable) to the interpreter to be used.​When I use the which node command on terminal, I get /usr/local/bin/node so shouldn't I be using THAT path in my shebang? Also what does env really mean - the space between env and node in /usr/bin/env node made me think env is a directory which is clearly isn't. Any help would be much appreciated - nothing in my code is broken (for now) but I'm just curious as to how this works under the hood.

Submitted February 20, 2019 at 08:21PM by ksatia

No comments:

Post a Comment