diff --git a/packages/create-gatsby/src/init-starter.ts b/packages/create-gatsby/src/init-starter.ts index 25a23f49ec5bf..c06f84c315e1c 100644 --- a/packages/create-gatsby/src/init-starter.ts +++ b/packages/create-gatsby/src/init-starter.ts @@ -92,13 +92,7 @@ const install = async ( } } if (getPackageManager() === `yarn` && checkForYarn()) { - if (await fs.pathExists(`package-lock.json`)) { - if (!(await fs.pathExists(`yarn.lock`))) { - await execa(`yarnpkg`, [`import`]) - } - await fs.remove(`package-lock.json`) - } - + await fs.remove(`package-lock.json`) const args = packages.length ? [`add`, silent, ...packages] : [silent] await execa(`yarnpkg`, args) } else { diff --git a/packages/gatsby-cli/src/init-starter.ts b/packages/gatsby-cli/src/init-starter.ts index 2d7bea11b203e..9846aaad2791a 100644 --- a/packages/gatsby-cli/src/init-starter.ts +++ b/packages/gatsby-cli/src/init-starter.ts @@ -111,12 +111,7 @@ const install = async (rootPath: string): Promise => { } } if (getPackageManager() === `yarn` && checkForYarn()) { - if (await fs.pathExists(`package-lock.json`)) { - if (!(await fs.pathExists(`yarn.lock`))) { - await spawn(`yarnpkg import`) - } - await fs.remove(`package-lock.json`) - } + await fs.remove(`package-lock.json`) await spawn(`yarnpkg`) } else { await fs.remove(`yarn.lock`)