Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli/src/commands/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ interface TemplateReturnType {

// Here we are defining explicit version of Yarn to be used in the new project because in some cases providing `3.x` don't work.
const YARN_VERSION = '3.6.4';
const YARN_LEGACY_VERSION = '1.22.22';

const bumpYarnVersion = async (silent: boolean, root: string) => {
try {
Expand All @@ -91,9 +90,10 @@ const bumpYarnVersion = async (silent: boolean, root: string) => {
if (yarnVersion) {
// `yarn set` is unsupported until 1.22, however it's a alias (yarnpkg/yarn/pull/7862) calling `policies set-version`.
const setVersionArgs =
yarnVersion.major > 1
yarnVersion.major > 1 && yarnVersion.minor >= 22
? ['set', 'version', YARN_VERSION]
: ['policies', 'set-version', YARN_LEGACY_VERSION];
: ['policies', 'set-version', YARN_VERSION];

await executeCommand('yarn', setVersionArgs, {
root,
silent,
Expand Down