没有可用的包 nodejs。错误:无事可做。 Elastic Beanstalk 上的 Rails 应用程序

Posted

技术标签:

【中文标题】没有可用的包 nodejs。错误:无事可做。 Elastic Beanstalk 上的 Rails 应用程序【英文标题】:No package nodejs available. Error: Nothing to do. Rails App On Elastic Beanstalk 【发布时间】:2021-11-23 16:00:18 【问题描述】:

我已经在 Elastic Beanstalk 上使用我的 Rails 6 应用程序超过 6 个月了,没有任何问题。昨天突然在部署一些更改后构建开始失败,因为它无法安装NodeJs,这与我之前部署的更改无关。

我有用于 eb 配置的 01_download_nodejs02_install_nodejs 命令,自从我大约 6 个月前第一次设置应用程序以来,它们没有更改。

cfn-init.log 文件中显示以下内容:

2021-10-02 08:46:19,017 [INFO] Command 01_download_nodejs succeeded
2021-10-02 08:46:23,515 [ERROR] Command 02_install_nodejs (yum -y install nodejs) failed
2021-10-02 08:46:23,516 [ERROR] Error encountered during build of prebuild_2_sst_app: 
Command 02_install_nodejs failed
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
  CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
  self._config.commands)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
  raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 02_install_nodejs failed
2021-10-02 08:46:23,516 [ERROR] -----------------------BUILD FAILED!------------------------
2021-10-02 08:46:23,516 [ERROR] Unhandled exception during build: Command 
02_install_nodejs failed
Traceback (most recent call last):
File "/opt/aws/bin/cfn-init", line 176, in <module>
  worklog.build(metadata, configSets)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 135, in build
  Contractor(metadata).build(configSets, self)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 561, in build
  self.run_config(config, worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 573, in run_config
  CloudFormationCarpenter(config, self._auth_config).build(worklog)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/construction.py", line 273, in build
  self._config.commands)
File "/usr/lib/python3.7/site-packages/cfnbootstrap/command_tool.py", line 127, in apply
  raise ToolError(u"Command %s failed" % name)
cfnbootstrap.construction_errors.ToolError: Command 02_install_nodejs failed

cfn-init-cmd.log 文件中显示以下内容:

2021-10-02 08:46:18,976 P22197 [INFO] Command 01_download_nodejs
2021-10-02 08:46:19,017 P22197 [INFO] Completed successfully.
2021-10-02 08:46:19,017 P22197 [INFO] 
============================================================
2021-10-02 08:46:19,017 P22197 [INFO] Command 02_install_nodejs
2021-10-02 08:46:23,514 P22197 [INFO] -----------------------Command Output-----------------------
2021-10-02 08:46:23,515 P22197 [INFO]   Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
2021-10-02 08:46:23,515 P22197 [INFO]   No package nodejs available.
2021-10-02 08:46:23,515 P22197 [INFO]   Error: Nothing to do
2021-10-02 08:46:23,515 P22197 [INFO] ------------------------------------------------------------
2021-10-02 08:46:23,515 P22197 [ERROR] Exited with error code 1

01_download_nodejs:

command: "curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo -E bash -"

02_install_nodejs:

command: "yum -y install nodejs"

Elastic Beanstalk 平台版本:3.3.5

【问题讨论】:

很遗憾你的问题不清楚。您具体使用的是哪个 EB 平台版本? 版本为3.3.5 【参考方案1】:

您可能遇到的问题是由于 SSL 证书过期,如下所述:https://aws.amazon.com/premiumsupport/knowledge-center/ec2-expired-certificate/

您可以使用 .ebextensions 中安装最新证书的文件来解决此问题。例如,对于 Amazon Linux 1:

commands:
  00_ssl_certs:
    command: yum -y install https://cdn.amazonlinux.com/patch/ca-certificates-update-2021-09-30/ca-certificates-2018.2.22-65.1.24.amzn1.noarch.rpm

【讨论】:

以上是关于没有可用的包 nodejs。错误:无事可做。 Elastic Beanstalk 上的 Rails 应用程序的主要内容,如果未能解决你的问题,请参考以下文章

centos 6.8 上没有可用的软件包 mod_fastcgi

make dep: 'depend' 无事可做

你的领导工作能力很强,凡事喜欢亲力亲为,平时给你安排的工作很少且指导不多,导致你感觉来了几个月无事可做没有成长。对此,你怎么办?

制作文件问题:总是吐出“‘make.w’无事可做。”

CentOS 5 安装mysql-server失败,显示无事可做

VuejsMac下环境配置