From 5ea6ee0ed494c792a4c94928a83c5c85b9b6ac32 Mon Sep 17 00:00:00 2001 From: Steven Yung Date: Fri, 20 Oct 2023 15:19:05 +0200 Subject: [PATCH] fix(cli): prevent production install on add cmd (#8870) --- .changeset/great-queens-yawn.md | 5 +++++ packages/astro/src/cli/add/index.ts | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/great-queens-yawn.md diff --git a/.changeset/great-queens-yawn.md b/.changeset/great-queens-yawn.md new file mode 100644 index 000000000000..6ab1e857f411 --- /dev/null +++ b/.changeset/great-queens-yawn.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +prevent production install on astro add cmd diff --git a/packages/astro/src/cli/add/index.ts b/packages/astro/src/cli/add/index.ts index de27c368e0d8..42b16066577e 100644 --- a/packages/astro/src/cli/add/index.ts +++ b/packages/astro/src/cli/add/index.ts @@ -700,7 +700,11 @@ async function tryToInstallIntegrations({ ...inheritedFlags, ...installCommand.dependencies, ], - { cwd } + { + cwd, + // reset NODE_ENV to ensure install command run in dev mode + env: { NODE_ENV: undefined }, + } ); spinner.succeed(); return UpdateResult.updated;