Skip to content

Outdated doc, passing additional args to npm/yarn/Pnpm is no longer an array but an callback instead #807

@KageDG

Description

@KageDG

Page URL

https://github.com/CommunityToolkit/Aspire/tree/main/src/CommunityToolkit.Aspire.Hosting.NodeJS.Extensions#package-installation-with-custom-flags

Describe the issue

In a PR about 2 month ago the way you pass additional arguments for installation (in my case npm, but it seems the same for yarn and pnpm) got changed from an array to an callback instead. The linked documentation is outdated.

Merged PR

Suggestion

Update the documentation and show examples using callbacks.
Here´s one example:
Old:

builder.AddNpmApp("npm-app", "./path/to/app")
    .WithNpmPackageInstallation(useCI: false, args: ["--legacy-peer-deps"])
    .WithExternalHttpEndpoints();

New:

builder.AddNpmApp("npm-app", "./path/to/app")
    .WithNpmPackageInstallation(useCI: false, configureInstaller =>
    {
        configureInstaller.WithArgs("--legacy-peer-deps");
    }) 
    .WithExternalHttpEndpoints();

Additional context

No response

Help us help you

No, just wanted to report this

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions