diff --git a/eng/common/scripts/TypeSpec-Project-Generate.ps1 b/eng/common/scripts/TypeSpec-Project-Generate.ps1 index 839e0c6182f..2ad896fd812 100644 --- a/eng/common/scripts/TypeSpec-Project-Generate.ps1 +++ b/eng/common/scripts/TypeSpec-Project-Generate.ps1 @@ -73,6 +73,7 @@ function NpmInstallAtRoot() { $npmInstallCommand = "npm install --prefix $root $emitterName@$replacementVersion --no-package-lock --omit=dev" Write-Host($npmInstallCommand) Invoke-Expression $npmInstallCommand + if ($LASTEXITCODE) { exit $LASTEXITCODE } if ($hasPackageFile) { git restore package.json