oneuptime/clean-npm-install.sh
2022-12-16 14:22:23 +05:30

14 lines
361 B
Bash

# Loop through all the directories.
for d in */ ; do
PACKAGE_JSON=./$d/package.json
if test -f "$PACKAGE_JSON"; then
cd $d
rm package-lock.json || echo "Cant delete package lock file in $PACKAGE_JSON"
rm -rf node_modules || echo "Cant delete node_modules file in $PACKAGE_JSON"
npm i --force
cd ..
fi
done