Yarn executable was not detected in the system Ruby / Rails Origin: Application & API OSI layer 7 · Application Last updated 5 Nov 2026

Rails: Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install

Rails asset tasks (assets:precompile, webpacker/jsbundling) need Node and Yarn but they're not installed/on PATH.

Exact message you may see Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/installYarn executable was not detected in the systemWebpacker requires Node.js >= 6.0.0 and you are usingWebpacker can't find application.js in /public/packs/manifest.jsonbin/webpack: command not found
Seen on: Ruby Node.js

Meaning

Install Node.js and Yarn (corepack enable / npm i -g yarn), run yarn install, and in Docker/CI install Node in the build stage before precompiling. Rails 7 jsbundling-rails runs yarn build; match the Node version in .node-version.

Common causes

  • Node/Yarn missing in the image or server
  • PATH missing Node (nvm not loaded)
  • Webpacker/jsbundling needing yarn install
  • Different Node version than expected
  • Production precompile without devDependencies

⚡ Quick fix

  1. corepack enable && yarn install before rails assets:precompile
  2. Install Node in the Docker build stage
  3. Ensure PATH includes Node in CI/deploy scripts

Detailed fix by platform

Linux

  1. node -v && yarn -v && bin/rails assets:precompile

How to diagnose

  1. Node — Installed?
  2. Yarn — Available?
  3. Stage — Docker build?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

ActiveRecord::AssociationTypeMismatch — Rails: ActiveRecord::AssociationTypeMismatch: User(#1234) expected, got "42" which is an instance of String(#5678) (Ruby / Rails)ActiveRecord::Associa…ActiveRecord::ConnectionNotEstablished — Rails: ActiveRecord::ConnectionNotEstablished: No connection pool for 'ActiveRecord::Base' found (Ruby / Rails)ActiveRecord::Connect…ActiveRecord::Deadlocked: PG::TRDeadlockDetected — Rails: ActiveRecord::Deadlocked: PG::TRDeadlockDetected: ERROR: deadlock detected (Ruby / Rails)ActiveRecord::Deadloc…ActiveRecord::IrreversibleMigration — Rails: ActiveRecord::IrreversibleMigration — This migration uses remove_column without a type; db:rollback can't reverse it (Ruby / Rails)ActiveRecord::Irrever…Missing secret_key_base for 'production' environment — Rails: ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (Ruby / Rails)Missing secret_key_ba…script command not found — sh: vite: command not found (npm script) (npm)script command not fo…Sprockets::Rails::Helper::AssetNotPrecompiled — Rails: Asset `application.js` was not declared to be precompiled in production / The asset "application.css" is not present in the asset pipeline (Ruby / Rails)Sprockets::Rails::Hel…Yarn exec…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.