Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
boostrap nested npm modules
# boostrap nested npm modules installation
npm-boot() {
local INIT_DIR=$PWD
# go through all packages and install their dependencies
for package in `ls ./**/package.json | grep -v node_modules`
do
cd $INIT_DIR
cd $(dirname $package)
echo "Installing modules for $PWD"
# hack to make npm install common deps into the INIT_DIR
npm install --global --prefix=$INIT_DIR
done
cd $INIT_DIR
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment