PHP Laravel API build fails
fcaceres98
HOBBYOP

a month ago

ID: ba726ff7-7939-43b9-a2c0-27f918bf9a1c

I just rebuild a project and got a error about vite:

You are using Node.js 18.20.5. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.

failed to load config from /app/vite.config.js

How can I lock the vite version to work with node 18.20.5

$10 Bounty

10 Replies

a month ago

Hey, I suppose that using an older version of Vite (such as Vite 6) should work. You can lock a specific Vite 6 version by removing the ^ and specifying the version in question in your package.json.

Is there a reason why you have to stay on Node 18?


fcaceres98
HOBBYOP

a month ago

No actually that service is only backend


a month ago

I would suggest to use a newer Node version then, this way you don't really need to deal with an older version of Vite.


fcaceres98
HOBBYOP

a month ago

I tried to build it with the RAILPACK, but it didn't work


fcaceres98
HOBBYOP

a month ago

Error

Attachments


a month ago

Can you try specifying php ^8.4 in your composer.json?


fcaceres98
HOBBYOP

a month ago

I will


fcaceres98
HOBBYOP

a month ago

I added this to my package.json

"engines": {

"node": "20.19"

},

and it worked


fcaceres98
HOBBYOP

a month ago

And build it with the Nixpack


a month ago

Did you also try building with Railpack with the new configuration?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...