Improve missing npm install messaging#15732
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15732Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15732" |
There was a problem hiding this comment.
Pull request overview
Improves Aspire CLI UX when guest-language scaffolding can’t run npm install due to missing Node.js tooling by detecting the known “missing npm/npx” output and downgrading that case to a warning (when project creation already succeeded).
Changes:
- Added
AutomaticNpmInstallWarningmatcher + standardized warning message for missingnpm/npx. - Updated guest-language scaffolding and SDK codegen flows to treat missing Node tools as a warning in “best-effort” dependency installation paths.
- Added unit tests covering the matcher and the warning message text.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Utils/AutomaticNpmInstallWarningTests.cs |
Adds unit tests for missing-tool output matching and the warning message. |
src/Aspire.Cli/Utils/AutomaticNpmInstallWarning.cs |
Introduces a small matcher + warning message constant for missing npm/npx. |
src/Aspire.Cli/Scaffolding/ScaffoldingService.cs |
Converts missing Node tools during guest-language scaffolding dependency install into a warning and continues. |
src/Aspire.Cli/Projects/GuestAppHostProject.cs |
Adds an option to treat missing Node tools as a warning in the “best effort” dependency install after SDK codegen. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tests/Aspire.Cli.Tests/Utils/AutomaticNpmInstallWarningTests.cs
Outdated
Show resolved
Hide resolved
tests/Aspire.Cli.Tests/Utils/AutomaticNpmInstallWarningTests.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
Description
Improve CLI messaging when guest-language project creation cannot run
npm installbecause Node.js tools are missing.Before this change, the CLI surfaced the raw missing
npm/npxtool output or treated dependency installation as a failure even after project files had already been created. That made the TypeScript/guest-language scaffolding experience look broken or incomplete, even though the main issue was simply that Node.js was not available on PATH.This change adds a small matcher for the existing missing-tool output and uses it to convert that condition into a warning in the flows where project creation has already succeeded. The warning explains that the files were created, automatic
npm installcould not run, and the user should install Node.js and runnpm installmanually.Validation:
CommandPathResolverTestsandAutomaticNpmInstallWarningTests(10 passed)Dependencies: None.
Fixes #15420
Example warning output
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue: