Search code examples
amazon-ec2rubygemsruby-on-rails-5amazon-elastic-beanstalk

Rails 5.2.0 app Webpacker requires Yarn ">=1 <2" and you are using Yarn v0.1.1 2011, elastic beanstalk deployment failed


[DEPRECATION] The trollop gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible. Webpacker requires Yarn ">=1 <2" and you are using Yarn v0.1.1 2011 Jesper Kjeldgaard Please upgrade Yarn https://yarnpkg.com/lang/en/docs/install/ Exiting!

2021/03/03 05:06:35.767452 [INFO] Executing cleanup logic 2021/03/03 05:06:35.769905 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1614747995,"severity":"ERROR"}]}]}

2021/03/03 05:06:35.770091 [INFO] Platform Engine finished execution on command: app-deploy

[ec2-user@ip-172-31-28-237 log]$


Solution

  • If your are using Docker you should put these lines on your Dockerfile before the RUN apt-get update -qq && apt-get install .... part:

    RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
    RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list