diff --git a/.changeset/itchy-flowers-report.md b/.changeset/itchy-flowers-report.md new file mode 100644 index 0000000000..3c8e41c879 --- /dev/null +++ b/.changeset/itchy-flowers-report.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Resets `NODE_ENV` to ensure install command run in dev mode diff --git a/packages/astro/src/cli/install-package.ts b/packages/astro/src/cli/install-package.ts index d61a752dea..8dfd7c6c59 100644 --- a/packages/astro/src/cli/install-package.ts +++ b/packages/astro/src/cli/install-package.ts @@ -144,7 +144,13 @@ async function installPackage( await exec( installCommand.pm, [installCommand.command, ...installCommand.flags, ...installCommand.dependencies], - { nodeOptions: { cwd: cwd } }, + { + nodeOptions: { + cwd, + // reset NODE_ENV to ensure install command run in dev mode + env: { NODE_ENV: undefined }, + } + }, ); spinner.succeed();