Skip to content

rails new website --js=esbuild silently fails when yarn isn't installed #220

@j127

Description

@j127

rails new silently fails when yarn isn't installed, resulting in a broken project.

Steps to reproduce

Create a new Rails project like this:

rails _8.0.2_ new my_website --js=esbuild --css=tailwind --database=postgresql

Expected behavior

The command should fail because the resulting project is broken.

Actual behavior

The project gets generated, but it's broken due to no npm dependencies.

Here's the resulting package.json which is missing tailwind, esbuild, and hotwire dependencies:

{
  "name": "app",
  "private": true,
  "scripts": {
    "build": "esbuild app/javascript/*.* --bundle --sourcemap --format=esm --outdir=app/assets/builds --public-path=/assets",
    "build:css": "npx @tailwindcss/cli -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
  }
}

System configuration

Rails version: 8.0.2

Ruby version: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin24]

(M1 MacBook)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions