Registry / devops / npm-run-all2

npm-run-all2

JSON →
library8.0.4jsnpmunverified

`npm-run-all2` is a command-line interface (CLI) tool designed to efficiently manage and execute multiple npm scripts. It enables running scripts concurrently in parallel or in a specified sequence, offering fine-grained control over complex build or development workflows. As a maintenance fork of the popular `npm-run-all` package, its primary focus is on ongoing maintenance, modernizing the codebase, and ensuring compatibility with recent Node.js versions. As of its current stable version 8.0.4, it specifically requires Node.js 20 or greater. It maintains a consistent release cadence, frequently incorporating updates and addressing compatibility concerns. Its key differentiator is its commitment to supporting contemporary Node.js environments and acting as a well-maintained alternative to its predecessor, particularly for projects that require updated dependencies or strict Node.js versioning.

npm install npm-run-all2
INSTALL
IMPORT
SIG · NPM-RUN-ALL2
N
npm-run-all2
devopsjavascriptv8.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

runAll
import { runAll } from 'npm-run-all2'
const runAll = require('npm-run-all2')
Programmatic API for running scripts. CommonJS `require` is only fully supported up to v8.0.x. From v8.1.0-beta.0 (and subsequent v8.1.0 stable), the codebase is mostly ESM, favoring `import`.
runAllSync
import { runAllSync } from 'npm-run-all2'
const runAllSync = require('npm-run-all2').runAllSync
Synchronous version of the programmatic API. CJS `require` is only fully supported up to v8.0.x; use ESM `import` for v8.1.0-beta.0 and later versions due to ESM conversion.
CLI Entrypoint (programmatic)
import 'npm-run-all2/bin/npm-run-all2.js'
import { cli } from 'npm-run-all2'
While primarily a CLI, advanced use cases (e.g., testing or custom environments) might directly import the CLI entrypoint. Avoid if a higher-level API like `runAll` suffices. Direct `import` of the entrypoint is typically for side-effects or advanced scenarios.

Demonstrates `npm-run-all2` for parallel and sequential execution of npm scripts, including glob patterns, in a typical project setup.

{ "name": "my-project", "version": "1.0.0", "scripts": { "clean": "rm -rf dist", "lint": "eslint .", "build:css": "sass src/styles.scss dist/styles.css", "build:js": "rollup -c", "build": "npm-run-all2 build:*", "dev:server": "node server.js", "dev:watch:css": "sass --watch src/styles.scss:dist/styles.css", "dev:watch:js": "rollup -cw", "start": "npm-run-all2 --parallel dev:server 'dev:watch:*'", "full-setup": "npm-run-all2 clean lint build --sequential start" }, "devDependencies": { "npm-run-all2": "^8.0.0", "eslint": "^8.0.0", "sass": "^1.0.0", "rollup": "^4.0.0" } } // To run the parallel development setup: npm start // To run the full setup sequentially: npm run full-setup
npm-run-all --version
Debug
Known issues
breaking`npm-run-all2` has progressively raised its minimum Node.js version requirement. Version `8.0.0` requires Node.js `>=20.0.0`, while `7.0.0` required `^18.17.0 || >=20.5.0`. Ensure your Node.js environment meets these requirements to avoid execution failures.
fix
Upgrade your Node.js environment to version `20.5.0` or higher.
affects: >=7.0.0
breakingStarting with `v8.1.0-beta.0`, the codebase has largely converted to ES Modules. Programmatic users currently using `require('npm-run-all2')` will need to switch to ESM `import` statements when `v8.1.0` (or later versions) is officially released. This impacts how the library is consumed programmatically.
fix
Refactor programmatic imports from CommonJS `require()` to ESM `import { /* ... */ } from 'npm-run-all2'`.
affects: >=8.1.0-beta.0
gotchaIn `v8.0.2`, the internal glob matching library was switched from `minimatch` to `picomatch`, which was then reverted back to `minimatch` in `v8.0.3` due to unforeseen issues. Users on `v8.0.2` might have experienced different or incorrect glob matching behavior for script names compared to `v8.0.1` or `v8.0.3+`.
fix
Upgrade to `8.0.3` or higher to ensure consistent `minimatch` glob behavior.
affects: 8.0.2
gotchaThis package is a maintenance fork of `npm-run-all`. While generally compatible, `npm-run-all2` aims for more modern Node.js support and active maintenance. Ensure you are explicitly using `npm-run-all2` if you intend to benefit from its updated dependencies, stricter Node.js versioning, or active bug fixes not present in the original.
fix
Explicitly install `npm-run-all2` (e.g., `npm install --save-dev npm-run-all2`) and ensure your `package.json` scripts call `npm-run-all2` instead of `npm-run-all`.
affects: All versions
Errors
Common errors & fixes
Error: Minimum Node.js version not met. (Current: v16.x.x, Required: >=v20.x.x)
The installed Node.js version is older than the minimum required by `npm-run-all2`.
fix
Upgrade your Node.js environment to version `20.5.0` or higher (e.g., using `nvm install 20 && nvm use 20`).
`npm-run-all2: command not found` or `Error: Cannot find module 'npm-run-all2'`
The `npm-run-all2` package is not installed or not accessible in the current execution path.
fix
Install `npm-run-all2` locally as a `devDependency` (`npm install --save-dev npm-run-all2`) and ensure it's called via `npm run <script>` (which uses `node_modules/.bin`), or install it globally (`npm install -g npm-run-all2`) if you intend to use it directly from the terminal.
TypeError: require is not a function (after upgrading past 8.0.x)
Attempting to use CommonJS `require()` for programmatic imports after `npm-run-all2` has converted to ES Modules (from v8.1.0-beta.0 onwards).
fix
Refactor your code to use ESM `import` statements (e.g., `import { runAll } from 'npm-run-all2';`).
No such task: <script-name> (Did you mean <similar-script-name>?)` or unexpected script globbing results.
The glob pattern used for script selection does not match any existing scripts, or the glob behavior is not what was expected.
fix
Verify the script names in `package.json` and adjust the glob pattern accordingly. For `v8.0.2`, consider upgrading to `v8.0.3+` to revert to `minimatch` glob behavior.
Upgrade
Version history
8.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
npm-run-all2 — npm install npm-run-all2 · libregistry