To install nodejs using yum (assuming you're using the default Amazon Linux)
https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
Now to execute this on your instances, you need to add the required commands to a config file inside the .ebextensions
dir, something like: .ebextensions/01_install_dependencies.config
File contents:
commands:
01_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
02_install_nodejs:
command: yum -y install nodejs