componentjs / component

frontend package manager and build tool for modular web applications
https://github.com/componentjs/guide
MIT License
4.55k stars 305 forks source link

getting component module to be called with --harmony #636

Open AaronNGray opened 9 years ago

AaronNGray commented 9 years ago

component-install[.cmd] is auto generated an I cannot seem to be able to get component install to be called from my module via npm install with the --harmony flag set in node.js via an exec.

https://github.com/UKDemocracyOS/app/blob/development/bin/dos-install#L56

as this is calling component via npm and 'node_modules.bin\component-install' I cannot seem to get the contained component-install to run in harmony mode.

AaronNGray commented 9 years ago

Heres the generated code in 'node_modules.bin\component-install.cmd'

@IF EXIST "%~dp0\node.exe" (
  "%~dp0\node.exe"  "%~dp0\..\component\bin\component-install" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node  "%~dp0\..\component\bin\component-install" %*
)

or 'node_modules.bin\component-install'

#!/bin/sh
basedir=`dirname "$0"`

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/../component/bin/component-install" "$@"
  ret=$?
else 
  node  "$basedir/../component/bin/component-install" "$@"
  ret=$?
fi
exit $ret
timaschew commented 9 years ago

It's quite more easier to run it with iojs, because you don't need any flags for it.

If you really want to stick to node, here is a note how to run component with harmony flag for 0.11 and 0.12 https://github.com/componentjs/development#running-component

AaronNGray commented 9 years ago

Its more complicated in the app as component is loaded as a node module !

AaronNGray commented 9 years ago

Tim,

Things seem to be working now both on Windows as well as Linux ! You seem to have made a new master on cogent. I will test again at peak internet activity.