Thank you for trying to help. For some reason this does not seem to work.
In my package.json file I have.
“packageManager”: “yarn@3.6.4”,
“engines”: {
“node”: “22.20.0”,
“yarn”: “3.6.4”
}
However, when trying to deploy yarn still seems to default to 1.22.22:
###### WARNING:
Installing a default version (22.11.0) of Node.js.
This version is not pinned and can change over time, causing unexpected failures.
Heroku recommends placing the \`heroku/nodejs\` buildpack in front of
\`heroku/ruby\` to install a specific version of node:
https://devcenter.heroku.com/articles/ruby-support#node-js-support
###### WARNING:
Installing a default version (1.22.22) of Yarn
This version is not pinned and can change over time, causing unexpected failures.
Heroku recommends placing the \`heroku/nodejs\` buildpack in front of the \`heroku/ruby\`
buildpack as it offers more comprehensive Node.js support, including the ability to
customise the Node.js version:
https://devcenter.heroku.com/articles/ruby-support#node-js-support
-----> Installing node-v22.11.0-linux-x64
-----> Installing yarn-v1.22.22
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
error This project's package.json defines "packageManager": "yarn@3.6.4". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack .
rake aborted!
jsbundling-rails: Command install failed, ensure yarn is installed
/workspace/vendor/bundle/ruby/3.3.0/gems/jsbundling-rails-1.3.1/lib/tasks/jsbundling/build.rake:6:in \`block (2 levels) in <main>'
Tasks: TOP => assets:precompile => javascript:build => javascript:install
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
Timer: Builder ran for 16.513843977s and ended at 2025-10-14T13:00:40Z
ERROR: failed to build: exit status 1
Build failed 