Upon trying to remove the node_modules directory created by npm install
:
The source file name(s) are larger than is su
I just do del node_modules inside my project folder on PowerShell, it will ask you if you want to remove it and its children folder, just hit 'Y' and that's it
I made a Windows context item to fast delete node_modules or other folders. I use it when Windows doesn't delete a folder because of some invalid chars in the directory path.
Install rimraf => npm install rimraf -g
Create a new file named delete.bat
, set the content as below and copy it into c:\windows\system32\
delete.bat:
@ECHO OFF
ECHO.
ECHO %CD%
ECHO.
ECHO Are you sure to delete the folder with Rimraf?
PAUSE
SET FOLDER=%CD%
CD /
rimraf "%FOLDER%"
rem DEL /F/Q/S "%FOLDER%" > NUL
rem RMDIR /Q/S "%FOLDER%"
EXIT
Run fast-delete.reg file to import into registry.
Done!
Not exactly related, but as this is the first post I found in my search for a similar solution I think it's worth posting here.
I was running into permission issues on Windows 10 trying to delete my node_modules folder after a failed attempt at installing electron-redux. It seems electron-redux added @types to my node_modules, which had incorrect permissions set up.
rimraf did not work as it still ran into permission issues.
I ended up renaming node_modules then a simple delete worked.
Its too easy.
Just delete all folders inside node_modules and then delete actual node_module folder.
This Works for me. Best luck....
Any file manager allow to avoid such issues, e.g Far Manager
Sometimes, even if you install rimraf
globally you can have a local rimraf
dependency (SASS usually have it). In this case I would run following commands:
Follow first 2 steps as usagidon recommended, if you have issues or errors try
npm uninstall rimraf & rimraf node_modules
this will delete local rimraf
and use the global one