Skip to content

fix(@angular/cli): improve error message for project-specific ng commands when run outside of a project #23484

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2022

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Jul 1, 2022

With this change we improve the error message when a project for a command cannot be determined

Error: Cannot determine project for command.
This is a multi-project workspace and more than one project supports this command. Run "ng build [project]" to execute the command for a specific project or change the current working directory to a project directory.

Available projects are:
- project-name-0
- project-name-1
- project-name-2
- project-name-3
- project-name-4
- project-name-5
- project-name-6
- project-name-7
- project-name-8
- project-name-9

Closes #23481


Note: I haven't limited the number of project to display because we already display the full list when using the --help option and so far we didn't have complaints. We can re-evaluate and limit if someone opens an issue.

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release 2022Q3 Fixit Candidates for the Q3 2022 fix-it labels Jul 1, 2022
@alan-agius4 alan-agius4 requested a review from dgp1130 July 1, 2022 08:31
@alan-agius4 alan-agius4 force-pushed the cli-error-project-not-found branch 3 times, most recently from c14da57 to 1e16785 Compare July 1, 2022 08:46
…ands when run outside of a project

With this change we improve the error message when a project for command cannot be determined

```
Error: Cannot determine project for command.
This is a multi-project workspace and more than one project supports this command. Run "ng build [project]" to execute the command for a specific project or change the current working directory to a project directory.

Available projects are:
- project-name-0
- project-name-1
- project-name-2
- project-name-3
- project-name-4
- project-name-5
- project-name-6
- project-name-7
- project-name-8
- project-name-9
```

Closes angular#23481
@alan-agius4 alan-agius4 force-pushed the cli-error-project-not-found branch from 1e16785 to ff0f56e Compare July 1, 2022 09:15
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jul 1, 2022
@clydin clydin merged commit dbe0dc1 into angular:main Jul 1, 2022
@alan-agius4 alan-agius4 deleted the cli-error-project-not-found branch July 1, 2022 15:54
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for project-specific ng commands outside a project
2 participants