Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removing node_modules folder

The problem:

I've created a yeoman project by mistake on my windows box. Via explorer when I try to delete it I get an error saying that the path is too long.

Source too long error

Several Solutions:

  • https://superuser.com/q/78434/9546
  • https://stackoverflow.com/a/28999343/145682
  • Remove complete angular project built with Yeoman

But is there a script based solution?

like image 955
deostroll Avatar asked Apr 28 '15 09:04

deostroll


2 Answers

You could use rimraf:

npm install -g rimraf
rimraf C:\code\yeoman-foo
like image 185
Mac Avatar answered Sep 21 '22 12:09

Mac


You should be able to use the force switch. This script recursively removes any node_modules folder using PowerShell 3.

:> ls node_modules -Recurse -Directory | foreach { rm $_ -Recurse -Force }
like image 39
What Would Be Cool Avatar answered Sep 21 '22 12:09

What Would Be Cool