Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating to Yarn 2, but Yarn commands "set" and "policies" not found

I am trying to migrate a project to Yarn 2 like it describes on their website: https://yarnpkg.com/getting-started/migration

When I run yarn set version berry I get this error:

yarn run v1.7.0
error Command "set" not found.

This github forum post says "Make sure you're using Yarn 1.22 as your global binary, or use yarn policies set-version instead." I tried typing yarn policies set-version berry then I get the same error:

yarn run v1.7.0
error Command "policies" not found.

I am using Windows 7
node -v shows 13.14.0
yarn -v shows 1.7.0

like image 553
Michael Silverman Avatar asked Nov 08 '25 01:11

Michael Silverman


1 Answers

you should be in version 1.22 of yarn to be able to perform the set command

what solve to me the issue

yarn policies set-version
yarn set version berry
like image 195
jeremy-denis Avatar answered Nov 09 '25 19:11

jeremy-denis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!