如何使用AWS EB扩展编译Vuejs组件?
我在安装Nodejs和进一步在AWS Elastic Beanstalk上运行“ npm run production ”时遇到问题。 我正在编写configuration,并尝试了多个,但他们都不允许我安装nodejs。
我试图手动安装节点SSH到远程机器并运行:
“ sudo yum -y install nodejs npm –enablerepo-epel ”
但它安装了节点v0.10,然后我无法运行“ npm run prod ”(我猜这是因为Laravel Homestead默认使用节点v6.11。
用这个创build一个新的弹性beanstalkconfiguration文件 :
container_commands: 01_install_gcc: command: 'yum install -y gcc-c++ make' 02_download_node: command: "curl -sL https://rpm.nodesource.com/setup_6.x | bash -E" 03_install_node: command: 'yum install -y nodejs' 04_install_node_modules: command: 'npm install --save-dev cross-env' 05_run_production: command: 'npm run production'
这适用于64bit Amazon Linux 2017.03 v2.5.0 running PHP 7.1
Elastic Beanstalk服务器的64bit Amazon Linux 2017.03 v2.5.0 running PHP 7.1
。