0
votes

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"

The webpack config file helps to setup typescript with express.

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.

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?

1
run npm install first , then webpack, then startRobert Rowntree
how do i do that with elastic beanstalkShaun Chua

1 Answers

1
votes

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

file: /.ebextensions/ec2.config

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