![](/img/trans.png)
[英]Unable to deploy Rails with Tailwindcss and Webpacker to Elastic Beanstalk
[英]Deploy rails react app with webpacker gem on AWS elastic beanstalk
我正在尝试使用 AWS Elastic Beanstalk 部署使用 webpacker gem 创建的 rails 5.1 和 react 应用程序。 问题是我不断收到以下错误:
Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0
我在我的电脑上使用 Node 9.5.0。 有什么建议吗??
对于那些还需要安装 Yarn 的人,我发现以下内容对我有用:
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y"
02_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
03_install_nodejs:
command: yum -y install nodejs
使用 yum 安装 nodejs(假设您使用的是默认的 Amazon Linux)
https://nodejs.org/en/download/package-manager/#enterprise-linux-and-fedora
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
yum -y install nodejs
现在要在您的实例上执行此操作,您需要将所需的命令添加到.ebextensions
目录中的配置文件中,例如: .ebextensions/01_install_dependencies.config
文件内容:
commands:
01_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
02_install_nodejs:
command: yum -y install nodejs
对于那些在升级到 Rails 6 时发现这个问题的人,我写了一篇关于如何修复它的帖子。
基本上,您必须:
这相当于:
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y"
02_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
03_install_nodejs:
command: yum -y install nodejs
container_commands:
04_install_webpack:
command: npm install --save-dev webpack
05_precompile:
command: bundle exec rake assets:precompile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.