Express + Webpack弹性beantalk部署 [英] Express + Webpack elastic beanstalk deployment

查看:59
本文介绍了Express + Webpack弹性beantalk部署的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将服务器应用程序部署到弹性beantalk.webpack命令有问题.这是本地安装在dev依赖项上的.运行该应用程序的命令是:

trying to deploy my server application to elastic beanstalk. Having problems with the webpack command. This was installed locally on dev dependencies. The commands to run the application are:

"build": "webpack --config webpack.config.js",
"start": "npm run build && node ./dist/index.js"

webpack配置文件有助于使用express设置打字稿.

The webpack config file helps to setup typescript with express.

这已经通过AWS代码管道进行了设置,该管道在我的github master分支上侦听更改,随后触发了构建过程以部署到生产环境.

This has already been setup with AWS code pipeline that listens for changes on my github master branch, which subsequently triggers the build process for deployment to production.

返回的错误是"webpack:找不到命令".我在做什么错,这是什么解决方法?这与.ebextensions有什么关系吗?我会指示弹性beantalk在执行默认的npm start命令之前进行npm安装吗?

Error returned was "webpack: command not found". What am I doing wrong and what is the workaround this? Does this have anything to do with .ebextensions and do I instruct elastic beanstalk to do npm install before they execute the default npm start command?

推荐答案

Beanstalk仅安装依赖关系"中列出的依赖关系.如果要安装所有软件包,请添加带有说明的配置文件:

Beanstalk installs dependencies only listed in "dependencies". If you want to install all packages add a config files with instructions:

文件:/.ebextensions/ec2.config

container_commands:
    npmglobals:
        command: "sudo -u webapp npm i"

这篇关于Express + Webpack弹性beantalk部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆