You can just delete the node_module directory
rm -rf node_modules/
I added this to my package.json:
“build”: “npm build”,
“clean”: “rm -rf node_modules”,
“reinstall”: “npm run clean && npm install”,
“rebuild”: “npm run clean && npm install && npm run build”,
Seems to work well.