small medium large xlarge

30 Nov 2013, 15:18
Boris Egorov (2 posts)

I don’t know is it better to describe it here or in errata.

First line of cat.js (page 18 of PDF) looks like this:

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

When I run this code a shell tells me

/usr/bin/env: node --harmony: No such file or directory

If I remove --harmony token, it works fine.

Some research shows that we cannot pass arguments into env. So, this example needs to be fixed. Probably, node.js look at some environment variables to enable some version of ECMAScript?

Another solution could be to hardcode path to node:

#!/usr/bin/node --harmony
03 Dec 2013, 04:33
Jim R. Wilson (104 posts)

Thanks for reporting this! What OS are you using?

18 Dec 2013, 20:42
Boris Egorov (2 posts)

I use Debian 8 (Jessie).

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

For Ubuntu, I had to use the following shebang. I know you’re using Debian but perhaps it is a similar issue:

#!/usr/bin/nodejs --harmony
You must be logged in to comment