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

ManoharNuli opened this Issue Dec 4, 2018 · 1 comment


None yet
2 participants

ManoharNuli commented Dec 4, 2018

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


node v10.14.1
npm 6.4.1
ng 7.1.1
windows 10 Enterprise
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
The package to be added.

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.
Shows a help message for this command in the console.
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.


This comment has been minimized.


alan-agius4 commented Dec 4, 2018

Duplicate of #12454

@alan-agius4 alan-agius4 marked this as a duplicate of #12454 Dec 4, 2018

@alan-agius4 alan-agius4 closed this Dec 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment