In what context are you running yarn install? I don’t believe the CLI (where you’ve opened this issue) uses yarn. Did you mean to put this in a different category?
The solution is in the instructions of the track.
If you run corepack enable, you should no longer see this issue.
Having a global yarn version at 1.22.22 is fine as yarn set latest will locally (in a project folder) install higher versions using that global version.
The command corepack enable didn’t work for me. It runs without error but has no effect. The solution I found is to chance on package.json to the version of my local yarn, in my case: “packageManager”: “yarn@1.22.22”.
It seems the cause lies in Yarn: $ yarn set latest
yarn run v1.22.22
error Command “set” not found.
info Visit yarn run | Yarn for documentation about this command.
Node: $ node -v
v20.11.0
As it can be useful for other people, a workaround that is enabling to advance in the exercises is the downgrade. Below, I am getting the latest exercise version (Sept/25) of resistor-color: $ exercism download --track=typescript --exercise=resistor-color
Downloaded to
…/resistor-color $ cd ../resistor-color
$ yarn install
error This project’s package.json defines “packageManager”: “yarn@4.5.1”. However the current global version of Yarn is 1.22.22.
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 Corepack | Yarn.
$ corepack enable
$ yarn install
error This project’s package.json defines “packageManager”: “yarn@4.5.1”. However the current global version of Yarn is 1.22.22.
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 Corepack | Yarn.
$ vim package.json
Edited to yarn@1.22.22
$ yarn install
yarn install v1.22.22
info No lockfile found.
[1/5] Validating package.json…
[2/5] Resolving packages…
warning @jest/globals > @jest/expect > jest-snapshot > @jest/transform > babel-plugin-istanbul > test-exclude > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning @jest/globals > @jest/expect > jest-snapshot > @jest/transform > babel-plugin-istanbul > test-exclude > glob > inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jest > @jest/core > jest-config > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > glob@7.2.3: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > glob@7.2.3: Glob versions prior to v9 are no longer supported
[3/5] Fetching packages…
[4/5] Linking dependencies…
warning “babel-jest > babel-preset-jest > babel-preset-current-node-syntax@1.2.0” has unmet peer dependency “@babel/core@^7.0.0 || ^8.0.0-0”.
warning " > babel-jest@29.7.0" has unmet peer dependency “@babel/core@^7.8.0”.
warning “babel-jest > babel-preset-jest@29.6.3” has unmet peer dependency “@babel/core@^7.0.0”.
[5/5] Building fresh packages…
success Saved lockfile. Done in 19.71s.
All the issues are caused because you have likely manually installed yarn.
If you prefix all the commands with corepack, everything should work as documented.