Node.js Runtime Reference on Elastic Beanstalk¶
Prerequisites¶
- Working Node.js Elastic Beanstalk web server environment.
- Familiarity with project files
package.json,Procfile, and.platform. - Access to platform branch configuration in Elastic Beanstalk.
- Understanding of reverse proxy behavior in front of Node.js processes.
What You'll Build¶
You will map runtime behaviors for Node.js on Amazon Linux 2023: supported Node versions, dependency managers, nginx proxy integration, static file mapping, and package installation controls including .npmrc and node_modules handling.
flowchart TD
A[AL2023 Node.js Platform] --> B[Node version selected from platform branch]
A --> C[npm or yarn install workflow]
A --> D[nginx reverse proxy]
D --> E[Node process listening on PORT]
A --> F[Static files mapping]
A --> G[Deployment dependencies behavior] Steps¶
-
Select a platform branch that supports your required Node.js runtime generation.
-
Pin runtime expectations in
package.json. -
Understand dependency manager behavior.
- npm is used by default when
package-lock.jsonand npm metadata are present. - Yarn can be used when project metadata indicates Yarn-based dependency workflows.
- npm is used by default when
-
Confirm app process binds to Elastic Beanstalk provided port.
-
Customize reverse proxy and static file behavior when needed.
- nginx is in front of the application process by default.
- Static file mappings can be configured to serve assets efficiently from proxy layer.
- Proxy customization can be added via
.platform/nginx/.
-
Apply package install controls in repository configuration.
- Use
.npmrcfor npm install behavior settings as needed. - Understand whether
node_modulesshould be included or regenerated during deployment.
- Use
-
Deploy and validate runtime behavior.
Verification¶
- Environment runs on expected Node.js platform generation.
- Dependency installation behavior matches package manager strategy.
- nginx proxies requests to application process bound on
process.env.PORT. - Static assets and proxy customizations load without health check regressions.
- Installation settings from
.npmrcare reflected during deployment.