From 71455c16c371aaca4b5a551b713a77c6820efd78 Mon Sep 17 00:00:00 2001 From: wktk Date: Mon, 30 Oct 2023 20:22:18 +0900 Subject: [PATCH] fix(create-astro): TypeScript installation failure with yarn (#8939) Co-authored-by: Sarah Rainsberger Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com> --- .changeset/young-avocados-wink.md | 5 +++++ packages/create-astro/src/actions/typescript.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/young-avocados-wink.md diff --git a/.changeset/young-avocados-wink.md b/.changeset/young-avocados-wink.md new file mode 100644 index 0000000000..d7d1916ed0 --- /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 3be99e179c..2c0d21e89b 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);