Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Jan 9, 2026

The 'ng add' command now attempts to use '.angular/cache' or 'node_modules' as the base for temporary directories when acquiring packages. This ensures that the package manager can inherit project-specific configuration (like '.npmrc' or '.yarnrc') during the installation of temporary packages.

clydin added 2 commits January 9, 2026 11:06
… manager abstraction

This change introduces the ability to specify a base temporary directory when creating a `PackageManager` instance. This allows for creating temporary directories within the project structure (e.g., `node_modules/.tmp`), which enables package managers to correctly inherit project-specific configurations like `.npmrc` or `.yarnrc` during operations like `acquireTempPackage`.
The 'ng add' command now attempts to use '.angular/cache' or 'node_modules' as the base for temporary directories when acquiring packages. This ensures that the package manager can inherit project-specific configuration (like '.npmrc' or '.yarnrc') during the installation of temporary packages.

The implementation uses a fallback strategy, checking for candidate directories and defaulting to the system's temporary directory if none are found.
…on in ng add

This change enhances the error handling in the 'ng add' command's 'installPackageTask'. It now specifically catches 'PackageManagerError' exceptions and surfaces the standard output or standard error from the underlying package manager process. This provides users with more actionable information when a package installation fails.
@clydin clydin force-pushed the package-managers/temp-package-dir branch 8 times, most recently from 29a6564 to d89b476 Compare January 9, 2026 19:28
…ackages in bun

This change introduces a 'project-root' strategy for acquiring temporary packages, which is now enabled for Bun. Bun has difficulty discovering and using configuration files (like '.npmrc') when executed in an isolated temporary directory.

With the 'project-root' strategy, 'bun add' is executed directly in the project's root directory using the '--no-save' flag. This ensures correct configuration inheritance and reliable package resolution. The cleanup for this strategy is currently a no-op to avoid potentially destructive deletions within the project's 'node_modules'.
@clydin clydin force-pushed the package-managers/temp-package-dir branch from d89b476 to f1c95a4 Compare January 9, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant