Skip to content
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

ng [commandname] -- help throws error for few cli commands outside angular project #13128

Closed
ManoharNuli opened this issue Dec 4, 2018 · 2 comments

Comments

@ManoharNuli
Copy link

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ x] build
- [ x] serve
- [ x] test
- [ x] e2e
- [ x] generate
- [ x] add
- [ ] update
- [ x] lint
- [ x] xi18n
- [ x] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

node v10.14.1
npm 6.4.1
ng 7.1.1
windows 10 Enterprise
64bit
x64 -based processer
os win32

Repro steps

Install angular cli globally
Open command shell from any location
Run the below command
ng add --help

The log given by the failure

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (C:\Users\GGUB\AppData\Roaming\npm\node_modules@angular\cli\models\workspace-loader.js:35:19)
at WorkspaceLoader.loadWorkspace (C:\Users\GGUB\AppData\Roaming\npm\node_modules@angular\cli\models\workspace-loader.js:22:49)
at E2eCommand._loadWorkspaceAndArchitect (C:\Users\GGUB\AppData\Roaming\npm\node_modules@angular\cli\models\architect-command.js:176:49)
at E2eCommand.initialize (C:\Users\GGUB\AppData\Roaming\npm\node_modules@angular\cli\models\architect-command.js:28:20)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:744:11)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)

Desired functionality

C:\angular\app1>ng add --help
arguments:
collection
The package to be added.

options:
--defaults
When true, disables interactive input prompts for options with a default.
--dry-run (-d)
When true, runs through and reports activity without writing out results.
--force (-f)
When true, forces overwriting of existing files.
--help
Shows a help message for this command in the console.
--interactive
When false, disables interactive input prompts.

Mention any other details that might be useful

Help command works only inside angular project folder for all the commands. The above mentioned commands expects the user to be inside angular project folder and throws error on angular.json file. The Documentation on CLI doesn't mention this point.

@alan-agius4
Copy link
Collaborator

Duplicate of #12454

@alan-agius4 alan-agius4 marked this as a duplicate of #12454 Dec 4, 2018
@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 Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants