Delete node_modules folder recursively from a specified path using command line

后端 未结 7 1887
暖寄归人
暖寄归人 2021-01-29 18:26

I have multiple npm projects saved in a local directory. Now I want to take backup of my projects without the node_modules folder, as it is taking a lot of space a

相关标签:
7条回答
  • 2021-01-29 19:03

    When on Windows, I use the following .BAT file to delete node_modules recursively from the current folder:

    @for /d /r . %d in (node_modules) do @if exist %d (echo %d && rd %d /s /q) 
    

    Or, via CMD.EXE:

    cmd.exe /c "@for /d /r . %d in (node_modules) do @if exist %d (echo %d && rd %d /s /q)"
    
    0 讨论(0)
提交回复
热议问题