I am trying to use yarn4 in a nodejs project but I failed to setup with corepack following this doc: https://yarnpkg.com/corepack.
Below is package.json file:
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"packageManager": "[email protected]",
"license": "MIT"
}
When I run yarn install on that folder, I got below error:
error This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.22.21.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
I have run corepack enable already but I still get the same error. My node version is:
node --version
v18.17.0
yarn --version
1.22.21
what I should do to use yarn4?