Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

elastic-beanstalk-deployment

БесплатноБез исполняемых скриптовНе проверен

Use when deploying Node.js applications to AWS Elastic Beanstalk or troubleshooting deployment issues - provides dependency installation strategies, monorepo…

pr-pmот pr-pm★ 125 звёзд на GitHub12 установок в других каталогах

Об этом скилле

Elastic Beanstalk Node.js Deployment

Overview

AWS Elastic Beanstalk automates Node.js application deployment but has specific behaviors around dependency installation that can cause issues, especially with monorepos. Understanding when EB installs dependencies vs when it skips installation is critical for successful deployments.

Core principle: Choose between letting EB install dependencies (smaller packages, slower) or bundling node_modules (larger packages, more reliable).

When to Use

Use when:

  • Deploying Node.js applications to AWS Elastic Beanstalk
  • Encountering "Cannot find package" errors during deployment
  • Working with monorepo workspace packages
  • Need reliable deployments without npm registry dependencies
  • Deploying applications with private packages

Don't use for:

  • Non-AWS deployments
  • Docker-based deployments (different dependency strategy)
  • Simple apps with only public npm packages (standard approach works fine)

Official AWS Documentation

Reference: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/nodejs-platform-dependencies.html

Quick Reference: EB Dependency Installation Behavior

Condition EB Action npm Command
package.json exists, NO node_modules/ Installs dependencies npm install --omit=dev (npm 7+)
node_modules/ directory present Skips installation None - uses bundled modules

Deployment Strategies

Strategy 1: Let EB Install Dependencies (Standard)

Best for: Simple apps, all packages in npm registry, no monorepo

# GitHub Actions workflow
- name: Build application
  run: npm run build

- name: Create deployment package
  run: |
    zip -r app.zip \
      dist/ \
      package.json \
      package-lock.json \
      .ebextensions/

Pros:

  • Smaller deployment packages (5-10MB typical)
  • Consistent with npm ecosystem
  • Uses platform's npm version

Cons:

  • Slower deployments (installs on every deploy)
  • Requires all packages in npm registry
  • Can fail with network/registry issues

Strategy 2: Bundle node_modules (AWS Recommended for Special Cases)

Best for: Monorepos, private packages, reliability requirements

AWS official quote: "Bundle node_modules to bypass potential npm registry installation issues."

# GitHub Actions workflow
- name: Install production dependencies
  run: npm install --omit=dev

- name: Create deployment package
  run: |
    zip -r app.zip \
      dist/ \
      package.json \
      node_modules/ \
      .ebextensions/

Pros:

  • Bypasses npm registry issues
  • Faster deployments (no install phase)
  • Works with workspace packages
  • Reliable and predictable

Cons:

  • Larger packages (50-100MB typical)
  • Must ensure platform-compatible binaries

Monorepo / Workspace Package Strategy

The Problem

Running npm ci --production inside a monorepo workspace:

  • Creates symlinks to workspace packages (not actual files)
  • Results in incomplete node_modules (~3MB instead of ~50MB)
  • Causes "Cannot find package" errors during EB deployment

Example error:

Error: Cannot find module '@prpm/types'

The Solution: Clean Context Installation

Install dependencies outside the workspace context to get real files instead of symlinks:

- name: Create standalone package.json
  run: |
    mkdir -p /tmp/clean-install
    cd /tmp/clean-install

    # Copy package.json and replace workspace refs with file paths
    cp $GITHUB_WORKSPACE/packages/app/package.json .
    jq --arg workspace "$GITHUB_WORKSPACE" \
      '.dependencies["@workspace/pkg"] = "file:\($workspace)/packages/pkg"' \
      package.json > package.json.tmp
    mv package.json.tmp package.json

- name: Install dependencies (outside workspace)
  run: |
    cd /tmp/clean-install
    npm install --omit=dev --legacy-peer-deps

    # Verify critical packages (real directories, not symlinks)
    test -d node_modules/pg || exit 1
    test -d node_modules/@workspace/pkg/dist || exit 1

- name: Copy to deployment location
  run: |
    rm -rf packages/app/node_modules
    cp -r /tmp/clean-install/node_modules packages/app/

Key steps:

  1. Install outside workspace context
  2. Convert workspace dependencies to file: references
  3. Verify packages are real directories (not symlinks)
  4. Bundle complete node_modules in deployment

Environment Configuration

Override Production Install Mode

Set in Beanstalk console:

NPM_USE_PRODUCTION=false

Specify Node.js Version

In package.json:

{
  "engines": {
    "node": "20.x"
  }
}

Note: Version range feature not available on Amazon Linux 2023

Container Commands for Migrations

When bundling node_modules, migrations can run immediately:

# .ebextensions/migrations.config
container_commands:
  01_run_migrations:
    command: npm run migrate
    leader_only: true

Why this works with bundled approach:

  1. EB extracts deployme
Полный SKILL.md на GitHub

Установить elastic-beanstalk-deployment в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл elastic-beanstalk-deployment?

Use when deploying Node.js applications to AWS Elastic Beanstalk or troubleshooting deployment issues - provides dependency installation strategies, monorepo handling, and deployment best practices

Как установить скилл elastic-beanstalk-deployment?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл elastic-beanstalk-deployment запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить elastic-beanstalk-deployment с