0

I would like to use AWS OpsWorks and as an application layer I would like to use Node.JS v0.12.0. However, I noticed that the latest supported Node version is 0.10.33.

I also noticed that OpsWorks uses a custom Node package - opsworks-node.

So my question is, can I:

  • copy the OpsWorks cookbooks
  • substitute the opsworks-node package with the one from this repo - https://deb.nodesource.com/node_0.12
  • run the rest of the recipes unchanged

or will that break something (like something which is specific to the opsworks-node package and is not found in the regular node)?

If the above is not feasible, then how should I go about installing Node 0.12.0 using OpsWorks?

  • 1
    Reopened, as requested. Go ahead and provide your answer. – HopelessN00b Mar 13 '15 at 15:50
  • CloudOps? Do you mean OpsWorks? AWS doesn't have a product called CloudOps. – ceejayoz Mar 13 '15 at 15:59
  • @ceejayoz, yeah, stupid mistake. Fixed now. – Shade Mar 13 '15 at 16:16
0

The solution was pretty easy with only 1 hiccup.

I used the nodejs cookbook from the Chef Supermarket, which is compatible with the AWS Ubuntu 14.04 AMIs. I used this one in order to get a "regular" install - from a public package/source repository, and not from the repo that AWS maintains. However, the version of that cookbook's node was the same as on AWS - 0.10.x.

To get around that I created a simple wrapper cookbook around the mainline nodejs that overrides the following attributes:

default['nodejs']['version'] = '0.12.0'
default['nodejs']['repo'] = 'https://deb.nodesource.com/node_0.12'

The default recipe then just includes the nodejs cookbook default one.

The only OpsWorks-specific change I needed to cater to (the hiccup) was the node binary location - OpsWorks looks for the node binary in /usr/local/bin/node, while the nodejs cookbook-installed package puts that binary in /usr/bin/nodejs. To fix this, I created a second recipe - create-symlink, which just creates a symlink of the installed binary in /usr/local/bin/.

The wrapper cookbook can be found here (with setup instructions) - https://github.com/zupper/nodejs-wrapper-opsworks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.