diff --git a/.changeset/young-avocados-wink.md b/.changeset/young-avocados-wink.md new file mode 100644 index 000000000000..d7d1916ed070 --- /dev/null +++ b/.changeset/young-avocados-wink.md @@ -0,0 +1,5 @@ +--- +'create-astro': patch +--- + +Fixes TypeScript installation issue with yarn diff --git a/packages/create-astro/src/actions/typescript.ts b/packages/create-astro/src/actions/typescript.ts index 3be99e179cad..2c0d21e89bcb 100644 --- a/packages/create-astro/src/actions/typescript.ts +++ b/packages/create-astro/src/actions/typescript.ts @@ -82,12 +82,12 @@ const FILES_TO_UPDATE = { try { // add required dependencies for astro check if (options.ctx.install) - await shell(options.ctx.packageManager, ['install', '@astrojs/check', 'typescript'], { + await shell(options.ctx.packageManager, ['add', '@astrojs/check', 'typescript'], { cwd: path.dirname(file), stdio: 'ignore', }); - // inject addtional command to build script + // inject additional command to build script const data = await readFile(file, { encoding: 'utf-8' }); const indent = /(^\s+)/m.exec(data)?.[1] ?? '\t'; const parsedPackageJson = JSON.parse(data);