Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App is still started with node 0.10.25 after fresh deployment #2

Open
juodumas opened this issue Apr 27, 2015 · 11 comments
Open

App is still started with node 0.10.25 after fresh deployment #2

juodumas opened this issue Apr 27, 2015 · 11 comments

Comments

@juodumas
Copy link

Looks like there is a problem with PATH. App starts with 0.10.25, but node --version via SSH reports 0.12.0... Maybe OpenShift has changed something?

To reproduce:

  1. rhc app create nodeapp nodejs --from-code=git://github.com/ryanj/nodejs-custom-version-openshift.git
  2. Add console.log('VERSIONS', process.versions); to server.js, git push.
  3. Here is rhc tail output after pushing:
VERSIONS { http_parser: '2.0', node: '0.10.25', v8: '3.14.5.10', ares: '1.9.1', uv: '0.10.23', zlib: '1.2.3',   modules: '11', openssl: '1.0.0-fips' }
@Behukob
Copy link

Behukob commented May 12, 2015

i have same issue

@hipek
Copy link

hipek commented May 13, 2015

Hi,

I have the same problem. Any idea or workaround?

Thanks.

@icflorescu
Copy link

Until this is solved, have a look at this auto-updating Node.js cartridge.

@hipek
Copy link

hipek commented May 13, 2015

Thanks Icflorescu. It works for me.

@jonface
Copy link

jonface commented Jul 7, 2015

I'd be interested in getting this fixed if possible, thanks.

@Spouwny
Copy link

Spouwny commented Sep 15, 2015

I found a workaround.

the cartridge is calling a nodjs_context() function before launching node.
This function checks $OPENSHIFT_NODEJS_VERSION and if it is 0.10 make a call that ends up adding the path to node v0.10 before everything else.

My workaround was to edit .openshift\lib\utils and add export OPENSHIFT_NODEJS_VERSION=0.6 in the setup_path_for_custom_node_version() function.

How it looks after the edit:

.openshift\lib\utils

   #  Add the node binary path to the PATH.
   export OPENSHIFT_NODEJS_VERSION=0.6
   export PATH="$node_bin_path:${PATH}"

I can't assure that there is no side effects, but my app is now running on node v0.12

@oddmouse
Copy link

oddmouse commented Dec 3, 2015

Thanks @Spouwny. That did the trick for me. I'm running v5.1.0 just fine now.

@jorgecolonconsulting
Copy link

@Spouwny worked for me too. I mistakenly set OPENSHIFT_NODEJS_VERSION to 4.2.4 in the utils script. It's important, like you mentioned, that it's set to 0.6, EVEN IF YOU'RE NOT RUNNING 0.6. Wasted almost a day on this.

@jonface
Copy link

jonface commented Jan 2, 2016

@Spouwny - works for me, cheers.

@juandav
Copy link

juandav commented Feb 17, 2016

I need to install the latest version of nodejs and mongodb

@ryanj
Copy link
Owner

ryanj commented Mar 17, 2016

Thanks All!
I've added @Spouwny's fix to .openshift\lib\utils and bumped the default nodejs version to 5.9.0.

I had originally posted this content as a quick hack to demonstrate how someone could provide their own custom runtime on OpenShift (V2) using the .openshift application startup hooks. However, the nodejs runtime should ideally be provided by the platform (or by a cartridge).

I'd recommend trying @icflorescu's openshift-cartridge-nodejs in the future, since it offers a cleaner separation between the application sources and the javascript runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants