【问题标题】:Unable to to deploy a Rails 5 VueJS app on ElasticBeanstalk无法在 ElasticBeanstalk 上部署 Rails 5 VueJS 应用程序
【发布时间】:2020-01-11 10:37:45
【问题描述】:

我正在尝试将 VueJS rails 5 应用程序部署到 ElasticBeanstalk 上,当我尝试时遇到 EB 实例上的命令失败错误。

我尝试了一些建议,例如重新生成锁定文件,但无法通过下面显示的错误:

Command failed on instance. Return code: 1 Output: (TRUNCATED)...lation. 
error @nuxt/opencollective@0.3.0: The engine "node" is incompatible with 
this module. Expected version ">=8.0.0". Got "6.17.1" error Found 
incompatible module. info Visit https://yarnpkg.com/en/docs/cli/install 
for documentation about this command. 

Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn_install.sh failed. 
For more detail, check /var/log/eb-activity.log using console or EB CLI.

这里发生了什么,我怎样才能让部署工作?

谢谢

【问题讨论】:

    标签: ruby-on-rails vue.js ruby-on-rails-5 amazon-elastic-beanstalk webpacker


    【解决方案1】:

    这个问题的答案是 EBS 使用了像 6.X 这样的超级老版本的 NodeJS。

    您需要在 /.ebextensions 中添加一些命令来删除旧的和更新。以下是我发现的特定于升级 NodeJS 的代码的一部分

    # .ebextensions/fix_rails_6.config
    
    commands:
    
      00_remove_node_6_if_present:
        command: "/bin/rm -rf /var/cache/yum && /usr/bin/yum remove -y nodejs && /bin/rm /etc/yum.repos.d/nodesource* && /usr/bin/yum clean all && rm -rf /var/cache/yum"
        ignoreErrors: true
      01_download_nodejs:
        command: "curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -"
      02_install_nodejs:
        command: "yum -y install nodejs"
    

    【讨论】:

      猜你喜欢
      • 2019-02-09
      • 2019-08-20
      • 2019-04-05
      • 2016-06-23
      • 2020-08-01
      • 1970-01-01
      • 2020-08-11
      • 2017-01-13
      • 1970-01-01
      相关资源
      最近更新 更多