A node application has required me to run node with a harmony flag, like:
node --harmony app.js
What is this harmony flag? What does it do and why can’t the app run without it?
I’ve tried looking into node command-line options (node --help), but it doesn’t provide any details either. Node docs weren’t of any help either.
Typing
man nodehas this on the harmony flag:So
--harmonyis a shortcut to enable all the harmony features (e.g.--harmony_scoping,--harmony_proxies, etc.) From this blog post, it seems harmony enables new ECMAScript 6 features in the language. The reason your file won’t run without harmony is becauseapp.jsis probably using non-backward compatible features from the new ECMAScript 6 standard (like block scoping, proxies, sets, maps, etc.)