node version error

rubinovitzPRO

6 months ago

Starting container
Unsupported Node.js version! Your version: v18.18.2. Required version: >=19.9.0.

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

10 Replies

6 months ago

Nixpacks defaults to node 18, you can specify a node version in your package.json file


dev

Nixpacks defaults to node 18, you can specify a node version in your package.json file

rubinovitzPRO

6 months ago

I did in both nixpacks.toml and package.json and railway wont pick it up


6 months ago

Important to note that you can only specify major versions so you might need to specify version 20 and not version 19.9.0


dev

Important to note that you can only specify major versions so you might need to specify version 20 and not version 19.9.0

rubinovitzPRO

6 months ago

I specified 22 in nixpacks


6 months ago

In nixpacks? Meaning in your nixpacks.toml file? How are you doing that?

Also, I'd recommend specifying the node version in your package.json file instead anyway since it's a project requirement and not a Railway-specific requirement


dev

In nixpacks? Meaning in your nixpacks.toml file? How are you doing that?Also, I'd recommend specifying the node version in your package.json file instead anyway since it's a project requirement and not a Railway-specific requirement

rubinovitzPRO

6 months ago

hi have tried this too and its not working.


rubinovitzPRO

6 months ago

Updated to Pro to try to get a response here that works


6 months ago

You just need to set your node version in package.json, although if that for some reason isn't working for you then you could try doing it via setting NIXPACKS_NODE_VERSION to 20 in your service variables too, that should override any other settings that could be messing this up (although setting it in package.json is still my recommended method for this situation)


rubinovitzPRO

6 months ago

I figured it out.

Had to update the version of nixpacks in railway.json to:
```
{

"$schema": "https://railway.app/railway.schema.json",

"build": {

"nixpacksVersion": "1.30.0",

"builder": "NIXPACKS"

}

}
```


6 months ago

I wasn't aware you manually specified a nixpacks version, so the problem was that you were using a nixpacks version that didn't support node 22. I did advise you to use node 20 though and that would've worked if you followed my instructions. Glad you got it working nonetheless though.


node version error - Railway Help Station