Specify node version for fly.io deployment via wasp deploy fly deploy
Seeing this error when my server launches on fly.io
Is there a way to specify the version of node the Dockerfile uses via
wasp deploy fly deploy
?
Wasp version 0.16.329 Replies
Hi @wardbox. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the error message you're seeing, it appears that the Sharp module requires Node.js version ^18.17.0 ^20.3.0 >=21.0.0, but your Fly.io deployment is using Node.js v20.0.0, which doesn't meet these requirements.
From the knowledge sources provided, I can see that Wasp has been updating its Node.js version requirements over time. In the past, Wasp had strict Node.js version requirements (only supporting specific LTS versions), but in more recent versions (since around version 0.12), Wasp has relaxed these requirements to support Node.js 18 and above.
However, I don't see specific information in the knowledge sources about how to customize the Node.js version used in the Dockerfile generated by
wasp deploy fly deploy
.
The error you're encountering is specifically related to the Sharp module, which requires a newer version of Node.js than what's currently being used in your deployment.
You might want to:
1. Check if there's a way to modify the Dockerfile that Wasp generates before deployment
2. Contact the Wasp team through their Discord or GitHub for specific guidance on customizing the Node.js version for Fly.io deployments
3. Consider using a compatible version of Node.js locally when developing your application
Unfortunately, the knowledge sources don't contain enough information to provide a definitive solution for specifying the Node.js version in the Dockerfile used by wasp deploy fly deploy
.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @wardbox, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?downgrading to
32.6
fixed it. trying a better fix now 😄
better fix didn't work :FeelsBadMan: i tried installing the relevant version for linux musl npm install --cpu=x64 --os=linux --libc=musl sharp
no dice, still needed a higher version of nodedid you ever get this to work?
no 😦
just have sharp pinned at 32.6
got dammit. I'm struggling with this too.
i think it's just because wasp needs a specific version of node, so gotta wait until it's bumped to ^20.3.0
two things I'm about to try:
1. change the node version in your
.wasp/build/Dockerfile
and run wasp deploy fly deploy --build-locally
if that doesn't work I'll try
2. create a Dockerfile in the root of your wasp project with the node version you need and it will append it to the end of your created dockerfile when you run wasp deploy, e.g.
Overview | Wasp
Wasp apps are full-stack apps that consist of:
I dont know much about Docker but I'd try creating the additional Dockerfile in root and just trying to deploy again. my local build is running now so I'll see if that works first
taking forever though
yay the custom root Dockerfile override is working

i had no idea that existed, pretty cool
hm. the server keeps crashing on fly after doing this.
maybe you're right that it's not possible to push the node version on the dockerfile to >= 22 for wasp. Any idea here @Carlos ?
i added the custom dockerfile config:
because a library depends on this version
How is it crashing?
it just never seems to get started
maybe i'm using a bad node version.
I think fly just sucks. I reverted back to the default node version and it still doen't deploy.
gonna try railway.
@Carlos do we have to use
alpine3.17
or is the latest version of alpine suitable?oof i don't follow alpine news so i don't really know, but i don't think there's any specific reason it shouldn't work on the last version
try it
yeah so prisma is the issue with
22.13.1-alpine
Seems this is fixed in Prisma 6.1+ https://github.com/prisma/prisma/issues/25817#issuecomment-2538544254
are we updating Prisma soon?
GitHub
Update to Prisma 6 · Issue #2504 · wasp-lang/wasp
@infomiho on Discord: Updating to Prisma 6 doesn't seem that problematic, we should do it sooner than later: https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-p...
looks like it 🙂
I guess before 1.0
hey ya'll @Vinny (@Wasp) @Carlos im running into this as well
whats the solution on this?
if there's a library that requires a higher node version you're going to just have to wait until next week when we release the new Wasp update. I believe we will update to Prisma v6 with that, is that correct @Filip ?
Becuase there is a prisma bug in versions <6 keeping us from being able to use node v >20
ya its all related @Carlos
i ended up finding 1 specific node version that works with vite 7 requirements, doesnt have prisma error or agron2 error
FROM node:20.19.0-bullseye-slim AS base
i rebuilt from source RUN npm rebuild @node-rs/argon2 --build-from-source
And made sure i built openssl libssl-dev
oki, we're investigating, probably launching a hotfix in the short future
@Zuck Like I mentioned in the other thread, this has been hotfixed in 0.16.7!
oh awesome ! @Filip