1

Specs: Ubuntu 14.04 LTS server --- NodeJS 5.7.0 --- NPM 3.6.0

I am running a custom cli tool with the starting command: #!/usr/bin/env node --harmony. Works fine on my local machine (also v5.7.0), but on my server I am getting:

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

My question is: How does one set harmony tool default's to true?

I have tried running:

node --v8-options | grep -A1 harmony

And this article says it should show true but all harmony tools appear to be disabled.

root@server:/home/iskore# node --v8-options | grep -A1 harmony

--es_staging (enable all completed harmony features)
    type: bool  default: false
--harmony (enable all completed harmony features)
    type: bool  default: false
  --harmony_shipping (enable all shipped harmony fetaures)
    type: bool  default: false
  --harmony_modules (enable "harmony modules" (in progress))
    type: bool  default: false
  --harmony_regexps (enable "harmony regular expression extensions" (in progress))
    type: bool  default: false
  --harmony_proxies (enable "harmony proxies" (in progress))
    type: bool  default: false
  --harmony_sloppy_function (enable "harmony sloppy function block scoping" (in progress))
    type: bool  default: false
  --harmony_sloppy_let (enable "harmony let in sloppy mode" (in progress))
    type: bool  default: false
  --harmony_unicode_regexps (enable "harmony unicode regexps" (in progress))
    type: bool  default: false
  --harmony_reflect (enable "harmony Reflect API" (in progress))
    type: bool  default: false
  --harmony_destructuring (enable "harmony destructuring" (in progress))
    type: bool  default: false
  --harmony_default_parameters (enable "harmony default parameters" (in progress))
    type: bool  default: false
  --harmony_sharedarraybuffer (enable "harmony sharedarraybuffer" (in progress))
    type: bool  default: false
  --harmony_atomics (enable "harmony atomics" (in progress))
    type: bool  default: false
  --harmony_simd (enable "harmony simd" (in progress))
    type: bool  default: false
  --harmony_array_includes (enable "harmony Array.prototype.includes")
    type: bool  default: false
  --harmony_tostring (enable "harmony toString")
    type: bool  default: false
  --harmony_concat_spreadable (enable "harmony isConcatSpreadable")
    type: bool  default: false
  --harmony_rest_parameters (enable "harmony rest parameters")
    type: bool  default: false
  --harmony_sloppy (enable "harmony features in sloppy mode")
    type: bool  default: false
  --harmony_arrow_functions (enable "harmony arrow functions")
    type: bool  default: false
  --harmony_new_target (enable "harmony new.target")
    type: bool  default: false
  --harmony_object_observe (enable "harmony Object.observe")
    type: bool  default: false
  --harmony_spreadcalls (enable "harmony spread-calls")
    type: bool  default: false
  --harmony_spread_arrays (enable "harmony spread in array literals")
    type: bool  default: false
  --harmony_object (enable "harmony Object methods")
    type: bool  default: false

Thank you in advance!

iSkore
  • 7,394
  • 3
  • 34
  • 59

1 Answers1

-1

This post should point you in the direction of all you need to know:

What does `node --harmony` do?

But also:

Set harmony flag to true in V8

Once you’ve got the source code, open up deps/v8/src/flag-definitions.h and look for Line 115

Change the flag from false to true.

DEFINE_bool(harmony, true, "enable all harmony features")

Compile Node

./configure && make && make install

Community
  • 1
  • 1
Hektor
  • 1,845
  • 15
  • 19
  • Yes, I came across this article. I see there *is* sort of a way to do this "harmonizing" but I would much rather not dig the source code of node itself. Is there a simple cli way to just flip that default? – iSkore Mar 01 '16 at 14:39
  • Are you using linux? – Hektor Mar 01 '16 at 14:41
  • Well as far as your development environment goes, you know you can just enable it with an alias? Probably not the answer you wanted... – Hektor Mar 01 '16 at 14:42
  • Otherwise I think you might (still) be out of luck – Hektor Mar 01 '16 at 14:46