Simple script designed to run the correct package install command in all folders that contain
a package.json recursively deep from the point the command is run
Born from the situation of having to set up a new development machine with over
30 different folders to run npm install. My motto is always "Work smarter, not
harder"
Imagine you've got the directory:
code
|--- project 1
|--- project 2
| |--- server
| |--- client
|--- project 3
Normally you'd have to go into each project folder and run npm install/yarn install/etc.
Now you can just run install-all in the code directory and the correct install will be run
for each subdirectory!
Install this globally so you can run it wherever you need to.
$ npm install -g install-all$ pnpm add -g install-all$ yarn global add install-all$ bun install -g install-allNavigate to the top level folder and run the following:
$ install-all| Flag | Short | Description |
|---|---|---|
--version |
-v |
Print the version number and exit |
--help |
-h |
Show help message and exit |
--clean |
-c |
Run clean install (npm ci, yarn/pnpm/bun install --frozen-lockfile) |
Use the --clean flag to perform a clean install in each project directory. This removes
existing node_modules and installs from the lock file exactly, which is useful for CI
environments or when you want a fresh, reproducible install:
$ install-all --clean