1

I'd like to get a simple generator function working on Openshift Online PaaS. I followed the instructions at nodejs-custom-version-openshift to run node 0.12 rather the default 0.10, and added a simple generator function to the bottom of server.js.

I added the harmony flag as per instructed, and it works locally with npm start and node server.js. However on Openshift I get:

DEBUG: Program node --harmony server.js exited with code 8
DEBUG: Starting child process with 'node --harmony server.js'
/var/lib/openshift/0000000000700003a/app-root/runtime/repo/server.js:33
function* idMaker(){
        ^
SyntaxError: Unexpected token *

Is there another, better way to use harmony/generators on Openshift?

KnewB
  • 353
  • 4
  • 16
  • Have you specified `"engines": {"node": ">= 0.12.0"},` in your `package.json`? Also try creating a file `.openshift/markers/NODEJS_VERSION` and put `0.12.5` in there – laggingreflex Jan 29 '16 at 06:10
  • thanks @laggingreflex the [repo I cloned from](https://github.com/ryanj/nodejs-custom-version-openshift) includes the engines entry for 0.12. I added `.openshift/markers/NODEJS_VERSION` and put `0.12.5` but no joy. I think OS is using 0.12 successfully as the Jenkins build log includes "Node.js version 0.12.0 is already installed" – KnewB Jan 29 '16 at 11:41

1 Answers1

1

Silly me for not looking at the issues page for the Github repo of this custom node version package, but this comment solved it, by adding a line in .openshift/lib/utils. Perhaps this Q/A still useful to someone!

KnewB
  • 353
  • 4
  • 16