You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot install package manager using corepack on node 16 #1075
Description:
No matter what node version you have chosen, the latest corepack will be used. The problem is that the latest corepack tries to use node's built-in fetch, which is not available in node 16
This is a quite common problem
Action version:
v4
Platform:
Ubuntu
macOS
Windows
Runner type:
Hosted
Self-hosted
Tools version:
Node: 16.20.2
Repro steps:
Set the packageManager filed in the package.json file
Expected behavior:
I expect the chosen package manager to be installed
Actual behavior:
Error: Error when performing the request to https://registry.npmjs.org/yarn/latest;
[cause]: TypeError: globalThis.fetch is not a function
at fetch (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22756:33)
Activity
[-]Cannot install package manager using corepack on node 16[/-][+]Cannot install yarn using corepack on node 16[/+][-]Cannot install yarn using corepack on node 16[/-][+]Cannot install package manager using corepack on node 16[/+]v-HarithaVattikuti commentedon Jun 7, 2024
Hello @SunsetTechuila
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.
kuco23 commentedon Jun 8, 2024
I am having the same issue with
failing on
yarnSunsetTechuila commentedon Jun 10, 2024
closing in favor of actions/runner-images#10036
SunsetTechuila commentedon Jun 13, 2024
update:
this happens because
corepack enableis run before setting up Nodewould be fixed by #901 since this works:
rn you can do this:
apply github actions fix actions/setup-node#1075 (comment)
kuco23 commentedon Jun 13, 2024
can confirm this fixed the issue