Setting node/npm global environment variable

65 views
Skip to first unread message

Aaron Gray

unread,
Apr 15, 2015, 7:16:28 AM4/15/15
to nod...@googlegroups.com
Hi,

I need to enable harmony globally (within exec environment space) for
node.js I don't want to have to use io.js though !

Basically I want something like :-

NODE=--harmony

I have .sh scripts reinvoking 'node' in compoentjs/component-install
and its loosing the --harmony flags and I cannot edit the files as
they are auto generated on install and I am trying to debug the
install process for component-install as it has timeout and retry
issues and possible latency or race condition.

Many thanks in advance,

Aaron

Ryan Schmidt

unread,
Apr 15, 2015, 10:31:54 AM4/15/15
to nod...@googlegroups.com

On Apr 15, 2015, at 4:35 AM, Aaron Gray wrote:

> I need to enable harmony globally (within exec environment space) for
> node.js I don't want to have to use io.js though !

I don't think node currently has a feature to do that.

If you can't edit your scripts to run "node --harmony", then you could create a wrapper script that would itself call "node --harmony" and then pass on the arguments. You would call this script "node" and put it in another directory, and then put that directory first in your PATH (or before the directory containing the real node executable). This assumes a UNIX-like operating system; I'm not sure how to do the equivalent on Windows.

Aaron Gray

unread,
Apr 15, 2015, 11:45:15 AM4/15/15
to nod...@googlegroups.com
Nice hack.
Reply all
Reply to author
Forward
0 new messages