Skip to content

Commit adf4f3f

Browse files
MurakamiShinyuuetchy
authored andcommitted
fix: Fails on Windows when Yarn is not installed
fixes #18
1 parent 09dbe7f commit adf4f3f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ async function installDeps(rootDir: string, useYarn: boolean) {
106106
args = ['install', '--cwd', rootDir];
107107
} else {
108108
command = 'npm';
109-
args = ['install', '--prefix', rootDir];
109+
args = ['install'];
110+
process.chdir(rootDir);
110111
}
111112
try {
112113
await spawnPromise(command, args, { stdio: 'inherit' });
@@ -307,7 +308,8 @@ export async function create(appName: string, options: Options) {
307308
args = ['--cwd', packageDir, 'add', packageName];
308309
} else {
309310
command = 'npm';
310-
args = ['install', '-D', packageName, '--prefix', packageDir];
311+
args = ['install', '-D', packageName];
312+
process.chdir(packageDir);
311313
}
312314
const child = spawn(command, args, { stdio: 'inherit' });
313315
child.on('close', (code) => {

0 commit comments

Comments
 (0)