在AWS Elastic Beanstalk上使用Webpacker gem部署Rails React应用
我正在尝试部署rails 5.1&使用AWS Elastic Beanstalk反应使用webpacker gem创建的应用程序.问题是我不断收到以下错误:
I'm trying to deploy a rails 5.1 & react app created with webpacker gem using AWS Elastic Beanstalk. The problem is I keep getting the following error:
Webpacker requires Node.js >= 6.0.0 and you are using 4.6.0
我在计算机上使用Node 9.5.0.有什么建议吗?
I'm using Node 9.5.0 on my computer. Any suggestions??
要使用yum安装nodejs(假设您使用的是默认的Amazon Linux)
To install nodejs using yum (assuming you're using the default Amazon Linux)
https://nodejs.org/en/下载/包管理器/#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
Now to execute this on your instances, you need to add the required commands to a config file inside the .ebextensions
dir, something like: .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