Replies: 1 comment 1 reply
-
I think that was fixed by nodejs/corepack#446. Can you confirm if you're getting the same results with Corepack 0.27.0? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a build infrastructure where we install Node.js and pnpm (via corepack) into a build folder which is then subsequently used to run install commands etc. COREPACK_HOME is also placed there (inside Node.js's installation folder) and It's never expected to be mutated after the initial installation thus the entire folder is marked as read-only. This also makes it more likely to have reproducible builds. The issue we are facing now is that running
corepack pnpm
(orpnpm
directly) with COREPACK_HOME set to the previously mentioned read-only folder results in an error along the lines of:Internal Error: EACCES: permission denied, open '/corepack_cache/lastKnownGood.json' at async Object.open (node:internal/fs/promises:637:25) at async Engine.getDefaultVersion (/node/v21.7.3/lib/node_modules/corepack/dist/lib/corepack.cjs:23337:29) at async executePackageManagerRequest (/node/v21.7.3/lib/node_modules/corepack/dist/lib/corepack.cjs:24207:28) at async BinaryCommand.validateAndExecute (/node/v21.7.3/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22) at async _Cli.run (/node/v21.7.3/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18) at async Object.runMain (/node/v21.7.3/lib/node_modules/corepack/dist/lib/corepack.cjs:24279:12)
Any ideas why this is the case? Why should
corepack
need write-access tolastKnownGood.json
even though I have set COREPACK_DEFAULT_TO_LATEST to 0 and don't even allow network access? Is there a way to prevent that from happening without bypassing corepack entirely?How to reproduce it
We can easily reproduce the issue by creating a docker environment (I've used the latest ubuntu image here):
then installing Node.js and pnpm in the docker environment, creating a guest user and switching to the guest user account
Now we can try to run pnpm after setting
COREPACK_HOME
etc. againwhich will spit out one of the above error.
Edit:
I made an issue for that on the corepack project page here: nodejs/corepack#459
Beta Was this translation helpful? Give feedback.
All reactions