You are using Node.js 18.20.4. For Next.js, Node.js version ">=20.9.0" is required.
lagametv
FREEOP

3 months ago

I'm having an issue where Next.js requires Node.js version 20 or later to build. My project uses Bun, so Railpack defaults to: bun │ 1.2.23 │ RAILPACK_BUN_VERSION (1.2.23)

I would like to specify which Node.js version Railpack should use for building.

I added the following environment variables in my .env file, but it seems that Railpack ignores the Node.js version setting:

RAILPACK_NODE_VERSION=22
RAILPACK_BUN_VERSION=1.2.23

Question: How can I configure Railpack to install and use a specific Node.js version while still using Bun (for example, Node 22 with Bun 1.2.23)?

Solved$10 Bounty

8 Replies

oranuare
PRO

3 months ago

Hi there! So, you have to set the node version in railway variables for the service to use it, not the .env file.

https://railpack.com/languages/node#detection

here you have also other ways you can set up those versions, included bun


lagametv
FREEOP

3 months ago

So in this case I should add a mise.toml to specify my node version?

1450151250648895700


oranuare
PRO

3 months ago

Any one of those will work, yes


oranuare
PRO

3 months ago

You could use environment variables, toml, .bun-version


oranuare
PRO

3 months ago

The easiest way is to add it directly in environment variables from the service


lagametv
FREEOP

3 months ago

Coul'd you provide an example?


lagametv
FREEOP

3 months ago

Is MISE_NODE_VERSION=22 correct?


lagametv
FREEOP

3 months ago

Got it working using this:

mise.toml

[tools]
node = "20.9.0"

but MISE_NODE_VERSION=20.9.0 worked too.


Status changed to Solved noahd 3 months ago


Loading...