oneuptime/clean-npm-install.sh

14 lines
361 B
Bash
Raw Normal View History

2022-12-16 08:52:23 +00:00
# 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