Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a nodejs file executable with --harmony option

Tags:

linux

node.js

Generally, I make a nodejs file can execute directly with below style

#/usr/bin/env node
nodejs code here

But, when node 0.11 support generators, I try below

#/usr/bin/env node --harmony
nodejs code here

It output

/usr/bin/env: "node --harmony": No such file or directory
like image 957
guilin 桂林 Avatar asked Jul 03 '14 08:07

guilin 桂林


1 Answers

You can't do that, you can however use the path to node directly:

#!/usr/bin/node --harmony

There're more details on Cannot pass an argument to python with "#!/usr/bin/env python"

like image 160
OneOfOne Avatar answered Oct 28 '22 05:10

OneOfOne