Skip to content

Commit

Permalink
Fix: legacy-peer-deps when using npm
Browse files Browse the repository at this point in the history
  • Loading branch information
OrJDev committed Feb 26, 2023
1 parent 35709ff commit d9ad103
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-chefs-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-jd-app": patch
---

Fix: legacy-peer-deps when using npm
5 changes: 3 additions & 2 deletions src/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ export async function installDeps(ctx: ICtx) {
);
const spinner = ora("Installing dependencies").start();
try {
await execa(`${ctx.pkgManager} install`, { cwd: ctx.userDir });
const flags = ctx.pkgManager === "npm" ? " --legacy-peer-deps" : "";
await execa(`${ctx.pkgManager} install${flags}`, { cwd: ctx.userDir });
spinner.succeed("Installed dependencies");
} catch (e) {
spinner.fail(`Couldn't install template dependencies: ${formatError(e)}`);
spinner.fail(`Couldn't install dependencies: ${formatError(e)}`);
process.exit(1);
}
}
Expand Down

0 comments on commit d9ad103

Please sign in to comment.