Open denchernov opened 4 months ago
Can you try using corepack yarn
everywhere you call yarn
directly, and report if that changes the output/result?
I tried to applied your suggestion: RUN corepack pack RUN corepack install -g yarn@4.0.2 RUN corepack yarn -v RUN corepack yarn config set nodeLinker node-modules RUN corepack yarn
It works on the image creation stage, but later, when AKS creates containers based on this image it fails with CrashLoopBackOff because it can't call a yarn command: 'yarn' is not recognized as an internal or external command
Do I need to specify a path to installed yarn? e.g.: RUN SETX /M PATH "%PATH%;C:\path\to\installed\yarn"?
I was able to solve this with the following:
# Cache yarn locally to avoid lookup at runtime
RUN corepack pack yarn@4.1.1
RUN carepack install -g --cache-only corepack.tgx
RUN chmod 444 /root/.cache/node/corepack/lastKnownGood.json
RUN chmod 555 /root/.cache/node/corepack
Took a lot of digging to find this in the unit tests: https://github.com/nodejs/corepack/blob/6efa34988229918debe6e881d45ba6715282f283/tests/main.test.ts#L507-L510
Would be nice if this was documented.
I'm trying to install yarn@4.0.2 for offline usage in a container.
Here is my dockerfile:
I do see that yarn@4.0.2 is downloaded in placed in the image in corepack.tgz and yarn installation starts according to the logs, but yarn is still not available afterwards. Here are the logs:
Am I doing anything wrong?