How do I use the older version of node.js buildpack? - node.js

I've been using Node.js as my runtime within Bluemix for a few weeks now but I saw somewhere that there's a new version of the runtime now live on Bluemix. I have some changes to my app that need to be pushed but I'm not sure if I'm quite ready to move to the new buildpack version yet. Is there a way to use the older version of the buildpack while I complete my testing?

Yes, you can still use v1.18, as it will be available on Bluemix for a period of time and can be accessed using the CF command below:
$ cf push your_app_name -b sdk-for-nodejs_v1-18-20150519-1759
Or, you can specify the following in your manifest.yml:
buildpack: sdk-for-nodejs_v1-18-20150519-1759
All available buildpacks installed on the system can be viewed using the following command:
$ cf buildpacks

If you're concerned about the default version of Node.js moving from 0.10 to 0.12 with the buildpack updates, it is still possible to manually specify the runtime version by setting the following property in your package.json file:
"engines": {
"node": "0.10.x"
}

Related

why I am using different node runtime version in cloud function?

as you can see at the image above, locally I am using node v10.16.3, but from cloud function dashboard it seems I still using runtime node JS 8. is this ok ? or do make something wrong ?
According tho the documentation: "You have to set the version in the engines field in the package.json file that was created in your functions/ directory during initialization" link.
Please keep in mind that Node.js 10 runtime is currently in beta.
For example, to use only version 10, edit this line in package.json:
"engines": {"node": "10"}

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.

Azure's node Deploy uses wrong Node and NPM

When I deploy to Azure WebSite the node runtime correctly uses the Nodejs I config in package.json, however the deployment script uses the node and NPM on the server's path. (The Server path is messed up and has both node version in the path.)
Ex. I want nodejs 4.2.1 and NPM >2
When I deploy an app it uses 0.10.x and NPM 1.x.x. My rxjs module requires NPM > 2 so it fails to load.
If I deploy avoiding the packages I can see the correct runtime is run.
Is there a way to fix this issue?
You can simply customize the nodejs version in Azure manage portal.
In CONFIGUE tab of your web site portal, under the APP SETTINGS section, the nodejs version is set as WEBSITE_NODE_DEFAULT_VERSION to 0.10.32 by Azure default, we can directly change it value to 4.2.1 you want.
Click the restart button at bottom nav bar after you modified the site setting.
Login on your KUDU console site, you can check the nodejs version in the cmdlet.(The site URL should be: https://{your site name}.scm.azurewebsites.net/DebugConsole)
And the nodejs version is 4.2.1 with npm version 3.3.9 after modification.
You can get more info at Specifying a Node.js version in an Azure application.
There are also atleast two other mentions on various sources claiming that it can be set via package.js:
"engines": {
"node": ">= 8.2.0 || 8.x.x",
"npm": ">= 5.3.0 || 5.x.x"
},
Or via the iisnode.yaml file in the site directory root. Which one does the trick is really hard to discover since you can only tell the node version correctly during runtime of the app.

meteor on openShift node version

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

Running latest unstable nodejs (e.g. 0.11.6) on heroku

I've not been having much luck finding an answer to this:
What is the simplest way to install/run the latest bleeding edge version of nodejs on heroku for an existing application?
There is the use of package.json engines as described here:
https://devcenter.heroku.com/articles/nodejs-support
But this does not cover the latest unstable 0.11.x branch which is the one I'm after.
Edit: as of 2013-12-12 the default buildpack can vendor any version of nodejs
Just specify the version you want in your package.json, e.g.
"engines": {
"node": "0.11.x"
}
Old:
I alomost wrote a buildback myself, but then found this one that vendors node binaries from nodejs.org:
https://github.com/arunoda/heroku-nodejs-binary-buildback
The instructions are simple, just don't forget to config:set NODE_VERSION.
YMMV: for me 0.11.7 caused NPM to fail to verify package checksums, but 0.11.6 works just fine.

Resources