yarn install fail with yarn3

It is my first app on fly.to
it is an existing application on heroku, running yarn3 with PNP
yarn launch set up my fly.toml to
[build]
builder = “heroku/buildpacks:20”

flyctl deploy fails, because it tried to run “yarn install --production=false”, while th flag is already removed in yarn3. Why? did I use the wrong builder?

Taking a look at the dates in the changelog for the node buildpack on heroku, I’d guess that this the fix for this issue is in the most recent buildpack, so you might try v22 instead, to see if that works.

we support a couple of different builders, so you might have more success using a Dockerfile. There’s some good discussion in the following thread:

Thanks for your reply, but I can’t find v22 (and I don’t actually understand what buildpacks are):

after changing the toml to

[build]
builder = “heroku/buildpacks:22”

I got

Error failed to fetch an image or build from source: failed to fetch builder image ‘Docker Hub’: image Docker Hub does not exist on the daemon: not found

do you mean I should use

[build]
builder = “heroku/buildpacks-nodejs:latest”

instead?

Oops I guess not, heroku/buildpacks-nodejs got a “not found”

I give up trying the builders or build packs, because i have no idea what they are doing. Instead, I created a Dockerfile to do the deployment. I think it more or less work for all yarn PNP projects.

FROM node:16.17.0-buster
RUN mkdir -p /usr
WORKDIR /usr
COPY .yarnrc.yml package.json server.js yarn.lock .pnp.cjs .pnp.loader.mjs ./
COPY .yarn/releases/ ./.yarn/releases/
COPY .yarn/plugins/@yarnpkg/ ./.yarn/plugins/@yarnpkg/
COPY .yarn/cache/ ./.yarn/cache/
COPY dist/ ./dist/
CMD [“node”, “-r”, “./.pnp.cjs”, “./dist/main.js”]