nx run-many only serves the first 3 specified projects
See original GitHub issue- I am running the latest version
"@nrwl/workspace": "^8.8.0" - I checked the documentation and found no answer
- I checked to make sure that this issue has not already been filed
- I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)
Expected Behavior
all specified projects get served, when running nx run-many --target=serve --projects=<more than 3 projects> --parallel
Current Behavior
only the first 3 projects get served
Failure Information (for bugs)
console outputs:
nx run-many --target=serve --projects=one,two,three,four --parallel
NX Running target serve for projects:
- one
- two
- three
- four
nx-min@0.0.0 nx <path-to-project>\nx-min
nx "run" "two:serve"
nx-min@0.0.0 nx <path-to-project>\nx-min
nx "run" "three:serve"
nx-min@0.0.0 nx <path-to-project>\nx-min
nx "run" "one:serve"
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
npx create-nx-workspace@latest nx-mincd nx-minnx g @nrwl/nest:application onenx g @nrwl/nest:application twonx g @nrwl/nest:application threenx g @nrwl/nest:application four- change ports so that all four have unique ports
nx run-many --target=serve --projects=one,two,three,four --parallel
Context
Please provide any relevant information about your setup:
nx report:
@nrwl/angular : Not Found
@nrwl/cli : 8.8.0
@nrwl/cypress : Not Found
@nrwl/eslint-plugin-nx : 8.8.0
@nrwl/express : Not Found
@nrwl/jest : 8.8.0
@nrwl/linter : 8.8.0
@nrwl/nest : 8.8.0
@nrwl/next : Not Found
@nrwl/node : 8.8.0
@nrwl/react : Not Found
@nrwl/schematics : Not Found
@nrwl/tao : 8.8.0
@nrwl/web : Not Found
@nrwl/workspace : 8.8.0
typescript : 3.5.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Nx CLI run many command is not working for multiple apps
Try this: nx run-many --parallel --target=serve --projects=frontend,backend.
Read more >Use Nx run-many to Run Commands in Multiple Projects
You can run multiple projects using the run-many command from Nx and setting a --target flag with the command you want to run....
Read more >How to Deploy Nx monorepos to Netlify
If you were looking for different strategies to deploy only the ... Part 3 – Using builders in Nx to deploy specific projects...
Read more >Set Your Multi-App Environment up in 5 Minutes - Dev Genius
nx run-many --target=serve --projects=client,backoffice,api ... file structure, and build, serve, lint, and test flows just in 3 minutes using 4 commands?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You should be able to work around this by setting the
--maxParallelflag to a high number, for example:The default value for
--maxParallelis three, meaning that it runs tasks in batches of three by default. Since the “serve” target never exits, therun-manycommand never made it to the second batch of tasks.To avoid further confusion about this situation, there could be a warning logged when the “serve” target is used with the
run-manycommand.Just have a quick question how we can serve multiple applications with port as well… For example previously we were doing like that ng serve appname --port=5200 ng serve appname2 --port=5201
Can we do that with nx run-many based on following example apps AngularApp1 AngularApp2 NestApp1 NestApp2
then the command should be like that nx run-many --target=serve --projects=AngularApp1,AngularApp2,NestApp1,NestApp2 --port=5200,5201 --parallel --maxParallel=4
notice i have provided port numbers for only angular applications and for the nest we can control that from environment files