CircleCI-Public / cimg-node

The CircleCI Node.js Docker Convenience Image.
https://circleci.com/developer/images/image/cimg/node
MIT License
41 stars 33 forks source link

Support corepack #212

Closed brandon-leapyear closed 2 years ago

brandon-leapyear commented 2 years ago

It would be nice to use corepack to avoid checking in the .yarn/releases/ binary, but running corepack enable fails with permission errors. For now, we can workaround it with --install-directory, but it would be great to get first-class support

KyleTryon commented 2 years ago

I have tested this locally and this is the same issue as #214. Resolving the node configuration (ideally via installing node via NPM) will resolve the issue. I have open #214 with more details which will solve this and all global package issues.

docker run -it cimg/node:17.5.0 bash
circleci@41ad909512de:~/project$ nvm install node
Downloading and installing node v17.6.0...
Downloading https://nodejs.org/dist/v17.6.0/node-v17.6.0-linux-x64.tar.xz...
######################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v17.6.0 (npm v8.5.1)
circleci@41ad909512de:~/project$ which node
/home/circleci/.nvm/versions/node/v17.6.0/bin/node
circleci@41ad909512de:~/project$ corepack enable
circleci@41ad909512de:~/project$ 
brandon-leapyear commented 2 years ago

:sparkles: This is an old work account. Please reference @brandonchinn178 for all future communication :sparkles:


@JalexChen thanks for the quick fix! i see cimg/node:17.8.0 has this change; would it be possible to backport the change to v16?