I have a script look like this:
#!/usr/bin/env node --harmony
When I run the script, it says "/usr/bin/env node --harmony: no such file or directory".
If I remove the "--harmony" on the first line, then it works.
What am I missing something?
Last edited by wrb302 (2013-08-19 01:29:05)
I don't think you can pass command line arguments through env like that. Just remove env and call node directly and it works:
#!/usr/bin/node --harmony ...
If you really need to use env to allow for node to be located somewhere else in the path, well then you still don't really need to use env:
#!/bin/sh exec node --harmony <<EOF console.log("hello") EOF
Last edited by Trilby (2013-08-19 00:32:25)
Thanks for your quick response. Actually this is a script in a node module I am trying to install: https://github.com/Sage/streamlinejs/bl … /bin/_node
This script actually works on Mac without problem.
Also, from man env it looks like it accepts arguments for command:
env - run a program in a modified environment
env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]
And I just tried running "/usr/bin/env node --harmony" in the console directly, it also works.
So I guess this is a quirk of Arch linux?
Looks like this is a defect in that script.