Skip to content

Instantly share code, notes, and snippets.

View DevNvll's full-sized avatar

Henrick Mello DevNvll

  • Rio de Janeiro, Brazil
View GitHub Profile
@SynCap
SynCap / remove_node_modules_recursively.ps1
Last active October 28, 2025 16:23
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
Note: Eliminate `-WhatIf` parameter to get action be actually done
Note: PS with version prior to 4.0 can't delete non-empty folders
#>
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force -WhatIf