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?
Best Answer
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: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 thenodejs
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