Created
November 1, 2017 16:32
-
-
Save julienroubieu/3a69a41157fe6c2b0793592ead866212 to your computer and use it in GitHub Desktop.
Run npm install in all subdirectories
This file contains 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
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && npm install" \; |
The following also works like a charm
find . -maxdepth 2 -name package.json -execdir npm i \;
@Wojciechowski-Marcin Thanks, works perfectly!
works like magic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I personally use this:
find . -name package.json -not -path "*/node_modules/*" -exec bash -c "npm --prefix \$(dirname {}) install --production --no-audit" \;