2016-03-01 160 views
1

規格:Ubuntu的LTS 14.04 ---服務器的NodeJS 5.7.0 --- NPM 3.6.0節點--harmony:沒有這樣的文件或目錄

我運行一個定製的CLI工具與起始命令:#!/usr/bin/env node --harmony。我的本地機器正常工作(也V5.7.0),但我的服務器我得到:

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

我的問題是:如何一組harmony工具默認的設置爲true?

我曾嘗試運行:

node --v8-options | grep -A1 harmony 

而且this文章說,它應該顯示true但所有harmony工具似乎被禁用。

[email protected]:/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 

預先感謝您!

+0

我也收到此,在MacOS沒有運行問題 - 把它放到Docker容器上,我得到這個 –

回答

-1

這篇文章應該指向你在所有的方向,你需要知道:

What does `node --harmony` do?

但也:

集和諧標誌設置爲true在V8

一旦你獲得源代碼,打開deps/v8/src/flag-definitions.h並查找第115行

將標誌從false更改爲tru即

DEFINE_bool(和諧,真實, 「使所有的和諧功能」)

編譯節點

的./configure & &使& &使安裝

+0

是的,我遇到了這篇文章。我看到*有一種方法可以實現「協調」,但我寧願不挖掘節點本身的源代碼。有沒有簡單的cli方法來翻轉默認值? – iSkore

+0

你使用的是Linux嗎? – Hektor

+0

Ubuntu 14.04 LTS – iSkore

相關問題