OK, what's the secret here? I thought this would work:
return dag
.container()
.from('node:18-slim')
.withExec(['corepack', 'enable'])
.withExec(['corepack', 'prepare', 'yarn@latest', '--activate'])
.withDirectory('/src', source)
Instead, this exits with:
Stderr:
error This project's package.json defines "packageManager": "yarn@4.1.1". However the current global version of Yarn is 1.22.22.
The logs, however, seem to indicate something else is initializing first (probably the typescript SDK):
144 : 6f2066e431fd41bb: Container.withExec(args: ["yarn", "set", "version", "stable"]): Container!
145 : 445ca20e99149742: Container.withExec(args: ["yarn", "workspaces", "focus", "--production"]): Container!
146 : 54f90a055b200d38: load cache: exec yarn workspaces focus --production
146 : 54f90a055b200d38: load cache: exec yarn workspaces focus --production DONE [0.0s]
177 : a49fb438ea5de5af: Container.withExec(args: ["yarn", "install"]): Container!
177 : a49fb438ea5de5af: Container.withExec(args: ["yarn", "install"]): Container!
181 : 4cf4d3ff7ec5ec75: exec yarn install
181 : 4cf4d3ff7ec5ec75: exec yarn install ERROR [0.6s]
So, what is the right way to to upgrade yarn?