Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm i runs Prepare script concurrently across all workspaces.
This causes major problems when using TypeScript and having one workspace dependent on another, since the build (prepare script) runs concurrently, there is no way to ensure the prepare command is done on one workspace before running on the next.
Expected Behavior
It to actually follow what the documentation says (https://docs.npmjs.com/cli/v7/using-npm/workspaces#running-commands-in-the-context-of-workspaces):

Nothing in there says anything about commands being run concurrently, or at the same time.
Steps To Reproduce
- Create 2 workspaces
- Add a prepare command to each where the second is reliant on the first completing
- Run
npm i
- Notice that everything fails since the commands are run concurrently
Environment
- npm: 8.1.0
- Node: v16.13.0
- OS: macOS 12.1 Beta (21C5039b)
- platform: MacBook Pro M1 Max
- npm config:
; "user" config from /Users/charliefish/.npmrc
//npm.pkg.github.com/:_authToken = (protected)
//registry.npmjs.com/:_authToken = (protected)
registry = "https://npm.network.charlie.fish/"
; node bin location = /Users/charliefish/.nvm/versions/node/v16.13.0/bin/node
; cwd = /Users/charliefish
; HOME = /Users/charliefish
; Run `npm config ls -l` to show all defaults.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm iruns Prepare script concurrently across all workspaces.This causes major problems when using TypeScript and having one workspace dependent on another, since the build (prepare script) runs concurrently, there is no way to ensure the prepare command is done on one workspace before running on the next.
Expected Behavior
It to actually follow what the documentation says (https://docs.npmjs.com/cli/v7/using-npm/workspaces#running-commands-in-the-context-of-workspaces):
Nothing in there says anything about commands being run concurrently, or at the same time.
Steps To Reproduce
npm iEnvironment