在AWS python elasticbeanstalk环境中安装requirejs优化器(nodejs)

我有一个基于python的AWS elasticbeanstalk应用程序,我试图用它来部署一个需要运行requirejs优化器的python应用程序。 为了优化我的requirejs代码,我需要NodeJS(首选)或其他方式来运行requirejs优化器。

如何在elasticbeanstalk python环境中安装nodejs?

我曾尝试使用yum和rpm,但无法findnodejs包。 理想情况下,它将通过更改elasticbeanstalk的.ebextensions / .config文件中的configuration进行安装。

谢谢

我find了答案:

而不是使用packages config来安装节点

packages: yum: nodejs: [] 

我使用自定义命令来安装nodejs使用yum自定义configuration启用epel回购

 container_commands: 01_install_node: command: "yum install -y --enablerepo=epel nodejs" 

我可以确认节点现在已安装在环境中,并且可以运行requirejs优化器。