Angular CLI: 6.0.1
Node: 8.9.0
OS: darwin x64 (Mac)
Angular: 6.0.1
ng --help it list the following commands:Lack of documentation for the following commands in the wiki page:
1. ng run
2. ng add
3. ng eject
and
1. `ng run --help` throws the error
Cannot determine project or target for Architect command.
Error: Cannot determine project or target for Architect command.
Please provide appropriate documentation for the listed commands on the wiki page.
and
1. `ng run --help` command should show help manual.
and
Running test case for the projects inside the workspace should be documented on the wiki
e.g: `ng test my-lib` run test cases for my-lib project
So after checking out the source code, it appears that ng run expects one argument in the form project_name:architect_target. For example, if your angular.json had something like this:
"projects": {
"login": {
"architect": {
"build": { ... },
...
},
...
},
...
}
You could ng run login:build (which appears to be the same as calling ng build login). I also notice that different architect targets like "serve" contain an "options" object with a "browserTarget" of the same form (i.e. "login:build"). So perhaps ng run is being used behind the scenes when you call other commands (like ng build login). I'm just speculating.
One thing that ng run allows is the ability to execute arbitrary / custom architect targets (i.e. ng run login:custom_target). Something I haven't figured out how to otherwise do. (a side affect of this seems to be that your architect targets can't contain the character :)
I got a similar error. Executing the command
ng build --target=production --configuration=prod --aot=true --source-map=true
resulted in
Error: Cannot determine project or target for Architect command.
I finally found that I needed to change the command to
ng run my-project:build:prod --target=production --aot=true --source-map=true
The wiki page about ng run is outdated.
What's really bugs me is that they have a defaultProject property, ng run et al should use that as the, well, default instead of throwing an error
@eranation that wouldn't be enough to fix this issue. You need to pass a project and architect target to ng run. Put another way, you're not running a project with this command.
ng lint wiki page is missing the --project option available in ng cli 6.x.
Hi all, Documentation for the CLI has been moved to https://angular.io/cli.
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._
Most helpful comment
I got a similar error. Executing the command
resulted in
I finally found that I needed to change the command to
The wiki page about
ng runis outdated.