Yarn 1.22.22 and Node.js 22.11.0

Today when I tried to deploy my app I got the following warnings:

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: Heroku Ruby Support | Heroku Dev Center
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: Heroku Ruby Support | Heroku Dev Center

I finally managed to deploy my app by downgrading to those versions. But I am quite stumbled. Isn’t there a way I can specify on Koyeb to use newer versions of Node.js and yarn? Or did I just not found it?

Yes, I know I could probably circumvent the problematic by using a Dockerfile to deploy. But that still feels too advance for me.

Hi Isabella, according to the documentation for deploying a Node.js application:

To specify the Node.js version to use, add or set the engines section in your package.json file:

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

If no version is specified in your package.json file, Node.js version 20.x will be used.

In addition, the docs note:

If you use yarn to manage your dependencies, a yarn.lock file must be present along with the package.json file.

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 :cross_mark: