我有一个基于python的AWS弹性柄应用程序,我正试图使用它来部署一个需要运行requirejs优化器的python应用程序。为了优化我的requirejs代码,我需要NodeJS(首选)或其他方式来运行requirejs优化器。
如何在松紧柄python环境中安装nodejs?
我尝试过使用yum和rpm,但找不到nodejs包。理想情况下,它将通过更改elasticbeastalk的.eextensions/.config文件中的配置来安装。
感谢
我找到了答案:
而不是使用软件包配置来安装节点
packages:
yum:
nodejs: []
我使用了一个自定义命令来使用yum安装nodejs,并使用自定义配置来启用epel repo
container_commands:
01_install_node:
command: "yum install -y --enablerepo=epel nodejs"
我可以确认节点现在已经安装在环境中,并且可以运行requirejs优化器。