Skip to content

Commit 70f5964

Browse files
committed
refactor(@angular/cli): skip cleaning node_modules for non-npm package managers
Other package managers (pnpm, yarn, bun) deterministically reconcile node_modules with the lockfile during installation, making full directory deletion unnecessary and slow. Keep node_modules cleanup only for npm for now.
1 parent a560aa9 commit 70f5964

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • packages/angular/cli/src/commands/update

packages/angular/cli/src/commands/update/cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs
567567
const tasks = new Listr([
568568
{
569569
title: 'Cleaning node modules directory',
570+
skip() {
571+
return packageManager.name !== 'npm'
572+
? 'Cleaning not required for this package manager.'
573+
: false;
574+
},
570575
async task(_, task) {
571576
try {
572577
await fs.rm(path.join(commandRoot, 'node_modules'), {

0 commit comments

Comments
 (0)