Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upng <command> --help does not work #16241
Comments
|
Are you trying to run this from inside a Angular project? Or globally , to use ng generate --help you need to be inside an Angular workspace. Let me know if that works, we can update the docs if needed. |
|
Yep, that was the problem. Outside of an angular project, Although this might be a source of misunderstanding. Using the --help flag produces a different error than using the command itself: Best solution could be updating the error message a bit maybe. Thank you for the help! |
|
That's a good suggestion @alan-agius4 what's your thought on this? |
|
We should fix this |
|
Please try to update the docs also because it can create a problem for person like me who is new in angular. Thanks. cli#basic-workflow |
|
Oh I believe it is really confused people who just new to angular cli and might be a kinda blocker for some, so this Here is the list of commands that does not work outside the angular project #19057:
|
Affected Package
The issue is caused by package @angular/cli
Is this a regression?
not sure.
Description
Angular cli commands seems to be working, but the --help flag does not work in them in angular 8. It is suggested in the documentation in multiple places that it should.
(
npm uninstall -g @angular/cli)npm install -g @angular/cli@latestng generate --helpforest@forest:~$ ng generate --helpforest@forest:~$ cat /tmp/ng-MYDOue/angular-errors.log[error] Error: Unable to locate a workspace file for workspace path. at Object.readWorkspace (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/core.js:74:19) at async GenerateCommand._loadWorkspace (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/models/schematic-command.js:442:35) at async GenerateCommand.initialize (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/models/schematic-command.js:40:9) at async GenerateCommand.initialize (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/commands/generate-impl.js:12:9) at async GenerateCommand.validateAndRun (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/models/command.js:124:9) at async Object.runCommand (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/models/command-runner.js:186:24) at async default_1 (/home/forest/.nvm/versions/node/v12.3.1/lib/node_modules/@angular/cli/lib/cli/index.js:54:31)forest@forest:~$ ^CAngular Version:
Anything else relevant?