meteor on openShift node version - node.js

meteor (v0.6.6.3) on openShift, customized openShift nodeJS to 0.10.21, mongoDB 2.2
I try to get a meteor app running on openShift. I have upgrade the nodeJS from the openShift default 0.10.5 to nodeJS 0.10.21 because meteor needs this nodeJS version as minimum.
If i open a ssh shell to openShift and let give me the node version than it shows me correct my upgraded version of 0.10.21 ( node --version ).
But if i will start the meteor application they see a nodeJS version of 0.10.5 (console log out with 'process.version' ) and starts again, again, again...
Can someone point me to the direction where i can look what's happened or what i'm doing wrong.
thanks

I 've prepared this "quickstart" solution,
it uses METEOR + NODE v0.10.24 (but it can be changed)
with Meteor example LeaderBoard and it can be easy transformed to your real application.
I have tested on Meteor 0.7.0.1
see: https://github.com/vladka/openshift-meteor-leaderboard-customNode

Edit (06.aug.2014)
As of now openshift is running nodejs version v0.10.25 which should be fine for running a meteor app. I am currently running one that is based on the 0.8.2/3 version.
Outdated answer (20. jan. 2014)
I have found the following repo, that according to the description lets you use any custom nodejs version.
Note: I am trying it out as we speak and will report back.
Edit
After 6 hours of trying out:
2 different app bootstraps (ryanj, openshift)
3-4 different nodejs cartridges from this repo
I gave up these approaches.
But made it work via the following steps:
I downgraded meteor to 0.6.5
meteor update --release 0.6.5
Used demeteorizer to "bundle app"
Copied contents of folder into the openshift dir created by following this tutorial
Replaced process.env.ROOT_URL in meteorshim with
process.env.ROOT_URL = "http://" + (process.env.OPENSHIFT_APP_DNS || "localhost");
Updated MIN_NODE_VERSION in programs/server/boot.js with:
var MIN_NODE_VERSION = 'v0.10.5';
git push and app was up & running

Changing the version of the software installed by a cartridge is not supported, but you can make a DIY app that has the version you want or roll you own nodejs cartridge with the version you want.

I created the openshift app using nodejs-0.10 instead of nodejs-0.6.
Then i followed this repo as mentioned by Matyas.
As the final step, i added new openshift env variable, something like:
rhc env add OPENSHIFT_youruniquestring_PATH_ELEMENT=/var/lib/openshift/xxxxxxxx/app-root/data/node-v0.10.29-linux-x64/bin -a yourAppName
Please adjust the values above to match yours.
After that try to make some dummy changes to your source code, then commit and push.
Once finished, you should run on node 0.10.29.
It worked for me, my app now running on meteor 0.8.3 with node 0.10.29

Related

How to change nodejs CLI version on Cpanel/Whm

On setup nodejs app in the cpanel menu, there are so many version choice.
But when I login using ssh, the shown version is v8.17.0. How to change to 12 or later?
First you need to create nodejs application on your cpanel then the NPM binary executable will be created on /home/yourcpanelusername/nodevenv/yourprojectname/12/bin/. So just use it, example:
~/nodevenv/yourprojectname/12/bin/npm install
or if using node:
~/nodevenv/yourprojectname/12/bin/node index.js

Meteor Buildpack for Cloud Foundry

I'm trying to get the meteor buildpack for cloud foundry running and its almost there except right at the end I get a node command not found error. I've confirmed that during the build I can run node and npm version commands. I get no errors until the instance fails to start.
Node gets installed into a folder called .vendor. I'm new to linux but is it possible that this folder isn't accessible at some point for some reason because of the dot? Meteor gets installed into a folder called vendor so I will try installing node there too. Can anyone think of something else to try?? I also tried changing the node folder to 777 in case it was a permissions thing. Far as I can tell the PATH variable is setup correctly.
I got the app deployed by converting to a node app and using the node buildpack but i'd prefer to use the meteor buildpack.

Meteor requires Node v0.10.41 or later Error on heroku deployment

I recently tried deploying my first MeteorJS (1.3) application on heroku and am getting a server log error - "Meteor requires Node v0.10.41 or later". Not sure what the relationship is between node and meteor. Do meteor apps actually need a node backend or is this a meteor bug?
Also, when I run "meteor node -v" I get v0.10.43 which IS a later version so I'm not sure what the problem is when deploying.
It's a problem with buildpack "jordansissel/heroku-buildpack-meteor.git"
Meteor 1.3 requires Node 0.10.41, and this buildpack compiles node at 0.10.40.
I submitted a pull request for a new buildpack, or try my fork at https://github.com/kevinseguin/heroku-buildpack-meteor.git
I've faced the same problem with deploying new version of meteor 1.3 and also spent the best part of the day, but eventually got easy solution!
You take last buildpack for meteor 1.3:
https://github.com/michaltakac/meteor-buildpack-horse and then doing everything as shown there, but instead doing git push heroku master, you do
git push -f heroku master
So the whole bunch for your commands:
>heroku create <yourapp>
>heroku buildpacks:set https://github.com/michaltakac/meteor-buildpack-horse.git
>heroku addons:create mongolab
>heroku config:set ROOT_URL=https://<yourapp>.herokuapp.com
>git push -f heroku master
Thanks to gitjason for his advice to get the right direction.
In case anyone else comes here, after trying the fixes here my app still had errors launching on Heroku, but the error messages were not verbose and only continued to give the Node version error. This series of fixes got it going.
1. in terminal, npm install - for me this re-installed npm. I also ran "meteor update" but I knew there was no significant update that would break my app.
2. check the .gitignore file - something important might be in there. In my case, "newrelic" folder was in there but not referenced as a dependency in package.json. To fix this make sure all subfolders have a dependency reference in package.json (recommended) or else remove node_modules from .gitignore (creates extra fetching, not recommended but works).
3. use Kevin's build path above - or another updated Meteor build package - I used the horse package. Make sure you add .git to the end of the URL like so:
heroku buildpacks:set https://github.com/kevinseguin/heroku-buildpack-meteor.git --app myAppName
4. set the $PATH - in terminal:
PATH=$PATH:$HOME/.meteor
5. set the ROOT_URL in Heroku - some instructions out there say to set it as "myAppName.herokuapp.com". This causes an error in Heroku. It is fixed if you prepend, "http://", like so, "http://myAppName.herokuapp.com".
Did you search on the web or in the Meteor documentation, before posting? From the documentation, it says,
Your JavaScript code can run in two environments: the client
(browser), and the server (a Node.js container on a server).
Basically, Meteor runs on top of node JS with all the boiler plate for reactivity and other features.
EDIT:
Now meteor also has a guide.

Adding a custom Node JS version to openshift doesn't work for my app

I have written an application which needs Node.js >= 4.2.6
I'm using the OpenShift service and the default Node.Js version is 0.10. Installing this https://github.com/ryanj/nodejs-custom-version-openshift is supposed to resolve this problem. So I followed the instructions and created a new application using:
rhc app create nodeapp nodejs --from-code=git://github.com/ryanj/nodejs-custom-version-openshift.git
So far so good. Next step - copy my project to the cloned git repository. Here's where I'm unsure if my approach is right (new to Node js). Because the cloned git already has a JSON package and because my app has its own JSON package in its root directory, I enriched the JSON package that came with nodejs-custom-version-openshift.git with my dependencies and set the engines to 4.2.6. The main is set to server.js. To run my app, I'm using "var variable = require('./myapp-master/test/test');" as the last line in my server.js. I copy the content of my app to the cloned repository (including node modules etc.) careful not to overwrite any existing config files like the JSON Package and then I use git push. The node version is installed properly according to the logs (upon build), servers.js is executed and it invokes my test.js. I can see in the app logs (app-root/logs) that test.js throws a specific error that indicates that the node js version is not >= 4.2.6.
When I log-in with PUTTY and write node -v, I get 4.2.6. When I navigate to my test.js and start it manually with node test.js, it runs normally. What am I doing wrong? I suspect I'm not handling the JSON packages properly (or my approach with starting my app from server.js is flawed). Any help is greatly appreciated! Thank you for your time.
Ok, I found the solution to this: https://github.com/ryanj/nodejs-custom-version-openshift/issues/2

Updating to Meteor 0.6.5, What version of Nodejs do you need, and can you still use Meteorite?

I would like to know what version of Nodejs you need to run Meteor 0.6.5?
Also can you still use Meteorite?
You should try to Google first.
Node 0.8.24
Reference: Meteor Change Log

Resources