0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

fix(cli): reset NODE_ENV to ensure install command run in dev mode (#12338)

This commit is contained in:
situ2001 2024-10-31 11:13:50 +08:00 committed by GitHub
parent 94eaeea1c4
commit 9ca89b3e13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Resets `NODE_ENV` to ensure install command run in dev mode

View file

@ -144,7 +144,13 @@ async function installPackage(
await exec( await exec(
installCommand.pm, installCommand.pm,
[installCommand.command, ...installCommand.flags, ...installCommand.dependencies], [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(); spinner.succeed();