-
Notifications
You must be signed in to change notification settings - Fork 12k
ng generate enum throws error #5018
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
Comments
did you provide a name as an argument? It should require one. If not, the error message should definitely be improved. |
I'm getting the same error and I am running it with a name as an argument. (eg. ng generate enum hello) I think it's failing in the file packages/@angular/cli/utilities/app-utils.ts on line 4 Unfortunately I don't know enough how the cli works to be able to be able to offer a fix or to be more help. |
Apologies. I did provide a name. I have updated my previous comment |
I will take a look at this, thanks for reporting. |
+1 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
@angular/cli: 1.0.0-rc.0
node: 6.10.0
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8
Repro steps.
run ng generate enum [name]
The log given by the failure.
TypeError: Cannot read property '0' of undefined
at Object.getAppFromConfig (C:\code\Angular2\dashboards\node_modules@angular\cli\utilities\app-utils.js:4:19)
at Class.normalizeEntityName (C:\code\Angular2\dashboards\node_modules@angular\cli\blueprints\enum\index.js:18:39)
at Class.Blueprint._normalizeEntityName (C:\code\Angular2\dashboards\node_modules@angular\cli\ember-cli\lib\models\blueprint.js:454:24)
at Class.Blueprint.install (C:\code\Angular2\dashboards\node_modules@angular\cli\ember-cli\lib\models\blueprint.js:513:8)
at Class.run (C:\code\Angular2\dashboards\node_modules@angular\cli\ember-cli\lib\tasks\generate-from-blueprint.js:59:49)
at Class.run (C:\code\Angular2\dashboards\node_modules@angular\cli\ember-cli\lib\commands\generate.js:71:17)
at Class. (C:\code\Angular2\dashboards\node_modules@angular\cli\ember-cli\lib\models\command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
Mention any other details that might be useful.
ran this as admin in cmder, cmd and git bash with same results
The text was updated successfully, but these errors were encountered: