How remove everything inside Node_modules with Yarn

I have accidentally use Yarn install while I was in the wrong file, but how could I remove them with Yarn properly?

It’s hard to tell exactly what you mean, but if you have modules that you don’t want, you can always use yarn remove. As a failsafe, if things are too messed up, you can delete the directory node_modules and correct your package.json and then just do another yarn install to repopulate node_modules correctly.

1 Like

I removed the node_modules via terminal, but i forgot to remove the package.json, therefore it kept installing in the previous old folder every time when I ran yarn install.

1 Like