Wednesday, April 9, 2014

Openshift Add --harmony flag to NodeJs

Trying to run Koajs or ES6 code with --harmony flag but getting 503 error on Openshift? Here’s how to solve it.

Get custom NodeJs cartridge

I’m using this one below instead of the orignal one.

rhc app create myapp nodejs-0.10 --from-code=git://

Change package.json

  "engines": {
    "node": ">= 0.11.12", //change this to 0.11.x for harmony
    "npm": ">= 1.0.0"
  "scripts": {
    "start": "node --harmony server.js"
  "main": " --harmony server.js" // Just add harmony flag here for Openshift deployment

Now push your code up to Openshift. It will run --harmony nicely.

Copyright © 2014 All Rights Reserved. No part of this website may be reproduced without’s express consent.

No comments: