Created
October 14, 2012 10:41
-
-
Save constantology/3888226 to your computer and use it in GitHub Desktop.
shell script to update and deduplicate npm modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# change the below line to point to your: PATH/TO/INSTALLED/NODEJS/lib/node_modules or just cd into the directory before running it | |
# cd $NODE_PATH; | |
npm update; | |
modules=`ls`; | |
for dir in $modules | |
do | |
cd $dir; | |
echo "dedupe|begin:$dir"; | |
sudo npm dedupe; | |
echo "dedupe|complete:$dir\n"; | |
cd ../; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment