I have a nodejs express app that makes use of some ES6 features, so it needs nodejs way above 0.12.18. But the AWS Opsworks Chef 11 stack only offers NodeJs up to 0.12.18.
I tried using my own custom cookbook/recipe and created 'opsworks_nodejs/attributes/customize.rb':
normal[:opsworks_nodejs][:version] = '14.2.0'
normal[:opsworks_nodejs][:prefix_url][:node] = 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/'
normal[:opsworks_nodejs][:rpm] = "nodejs-14.2.0-1nodesource.x86_64.rpm"
normal[:opsworks_nodejs][:rpm_url] = "https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodejs-14.2.0-1nodesource.x86_64.rpm"
But the setup fails and the logs show me that it tried to download a file that does not exist. It ignores my changes (except for the version part):
https://opsworks-instance-assets-eu-west-1.s3.amazonaws.com/packages/amazon/2018.03/opsworks-nodejs-14.2.0-1.x86_64.rpm
I wonder if there is a way to use the Chef 11 stack just like it is and only change the nodejs version to 14.2.0, as i am used to all the other recipes in use there, especially the deploy mechanism. All i want to differ is the node.js version.
If not, am i right in assuming that i have to use a Chef 12 stack that doesn't have those recipes pre-set? What would be the easiest way to just get nodejs 14.2.0 installed and still be able to use the convenient "Deploy"-feature the Chef 11 stack offers?
FWIW, adding this as an answer. There is a recommendation to use "at least" v14.10.9.
If you can have Chef client v14+ available, then you should be able to use the nodejs cookbook from Chef supermarket. Using Berkshelf (
Berksfile) we should be then able to pull this as a dependency.The sequence usually is:
Add dependency for community cookbook in
metadata.rb:Update / set the required attributes in
attributes/default.rbor may becustomize.rb:Then in a
recipes/default.rb: