Skip to content

Commit 71455c1

Browse files
wktksarah11918Princesseuh
authored
fix(create-astro): TypeScript installation failure with yarn (#8939)
Co-authored-by: Sarah Rainsberger <[email protected]> Co-authored-by: Erika <[email protected]>
1 parent 46d3043 commit 71455c1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/young-avocados-wink.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-astro': patch
3+
---
4+
5+
Fixes TypeScript installation issue with yarn

packages/create-astro/src/actions/typescript.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ const FILES_TO_UPDATE = {
8282
try {
8383
// add required dependencies for astro check
8484
if (options.ctx.install)
85-
await shell(options.ctx.packageManager, ['install', '@astrojs/check', 'typescript'], {
85+
await shell(options.ctx.packageManager, ['add', '@astrojs/check', 'typescript'], {
8686
cwd: path.dirname(file),
8787
stdio: 'ignore',
8888
});
8989

90-
// inject addtional command to build script
90+
// inject additional command to build script
9191
const data = await readFile(file, { encoding: 'utf-8' });
9292
const indent = /(^\s+)/m.exec(data)?.[1] ?? '\t';
9393
const parsedPackageJson = JSON.parse(data);

0 commit comments

Comments
 (0)