-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Enhancementnew feature or improvementnew feature or improvementPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 releaseconfig:workspacerelated to `--workspace`related to `--workspace`
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
when running a script across workspaces like npm run build --workspaces you'll most likely end up with errors if your workspaces depend on each other as npm doesn't execute the script in topological order. Other monorepo tools like Lerna do this automatically.
The only workaround is to not use "workspaces": ["packages/*"] in package.json, but manually enter and maintain the list of packages by hand.
Expected Behavior
Scripts should run in topological order.
Steps To Reproduce
- In any environment...
- With a config that has multiple workspaces and wildcard workspaces setting like
"workspaces": ["packages/*"], and one package that depends on another, and say both use TypeScript... - Run
npm run build --workspaces - See error from the compiler
Environment
- npm: 8.2.0
- Node: 16.9.1
- OS: macOS 12.0.1
- platform: macOS
- npm config:
legacy-peer-deps = true AlanGreene, timotheeguerin, t1m0thyj, felschr, busticated and 14 more
Metadata
Metadata
Assignees
Labels
Enhancementnew feature or improvementnew feature or improvementPriority 2secondary priority issuesecondary priority issueRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 releaseconfig:workspacerelated to `--workspace`related to `--workspace`