small medium large xlarge

17 Jun 2014, 12:43
Filip Abramowicz (2 posts)

Running the script (on Ubuntu 12.04) which starts with the following line:

’#!/usr/bin/env node –harmony’

ends up with:

‘/usr/bin/env: node –harmony: No such file or directory’

I’ve already tried: checking if there is execution permission on the partition, reinstalling NodeJS, creating symlink from node to nodejs

Nothing really worked, but what is strange executing the same script without ‘–harmony’ just with:

’#!/usr/bin/env node’

at the begining - worked well. I know that the ‘–harmony’ part is for some reason there and I am also sure this is some strange configurational issue related to my Ubuntu but perhaps somebody knows some other way (other syntax) to invoke node with the ‘–harmony’ part at the begining of this script?

14 Aug 2014, 04:08
Todd Decker (7 posts)

For Ubuntu 14.04 the following works:

#!/usr/bin/nodejs --harmony

You’ve probably figured out by now that on Ubuntu, ‘node’ is named ‘nodejs’.

05 Sep 2014, 20:59
Jim R. Wilson (106 posts)

Thanks for reporting this Todd, sorry it didn’t work as described. I should have tested on Ubuntu :(

09 Mar 2015, 20:13
Peter Verboven h/o Jupjo (5 posts)

Linux (unlike BSD) only passes a SINGLE argument to the shebang command:

so you can

#!/usr/bin/env node

but NOT

#!/usr/bin/env node --harmony

as a “workaround” for the exercises, I use

#!/usr/bin/node --harmony

This works with Linux but the script will not be portable to other Unix like systems!

You must be logged in to comment