If you've ever tried to delete an npm project on Windows, you've probably had this error window pop up. Trying various things like Shift-Del to permanently delete, or using 7Zip to delete, or using the command prompt rmdir command just doesn't work. Argh!
Windows just can't handle these incredibly long pathnames for nested node_modules folders. Fortunately since the problem is an npm issue, there is an npm solution.
The best one I've found is rimraf. It's an npm package that is designed to delete directories. If you haven't used npm before, don't fret. You do need to use the command prompt, but if you type in the following commands it should be straightforward.
Install the npm rimraf package globally on your computer. The "-g" global ensures that you can run rimraf from any directory.
npm install rimraf -g
Then open a command window in the parent directory of the directory you want to wipe off the face of the earth.
Type in the following and you should be free of the nested terror!
rimraf node_modules
Celebrate.
No comments:
Post a Comment