I have a shell script to run node with some arguments like so:
#!/usr/bin/env node --harmony_proxies
...
This works fine under OS X but in Ubuntu it errors with:
/usr/bin/env: node --harmony_proxies: No such file or directory
Node is definitely installed and on the PATH since if I remove the --harmony_proxies flag it works fine. Is there some different way of passing arguments when using env in Ubuntu?
On Linux, the entire string following the interpreter name is passed as a single argument to the interpreter, and this string can include white space. [1] Thus, command line arguments are not split, and
envcommand is trying to executenode --harmony_proxiesfile, which obviously could not be found. See here and here for more details.Here is an alternative solution for you:
Hope it helps. Good luck!