Max Kreutzfeldt

Feb 25, 2024

Delete manually node_modules folder

Sometimes it needs some rude action to clear trouble with npm and packages. If reinstalling packages only with the npm install command does not help out, it may help to remove the “node_module” folder (including the packages) manually and to install them back again on a cleared base. This is one of my “if nothing else works” solution.

# 1. remove 'node_modules' folder in the project
rm -rf node_modules

# 2. 'node_modules' clear cache
npm cache clean --force

# 3. install packages back again
npm install