question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng generate component fails

See original GitHub issue

I created a new project with the latest angular-cli npm packages 0.0.25 and can’t generate a component?

c:\temp\app5>ng generate component comp1
installing component
Cannot read property 'indexOf' of undefined
TypeError: Cannot read property 'indexOf' of undefined
    at Class.module.exports.normalizeEntityName (c:\temp\app5\node_modules\angular-cli\addon\ng2\blueprints\component\index.js:19:19)
    at Class.Blueprint._normalizeEntityName (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\lib\models\blueprint.js:434:24)
    at Class.Blueprint.install (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\lib\models\blueprint.js:492:8)
    at Class.module.exports.Task.extend.run (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\lib\tasks\generate-from-blueprint.js:60:49)
    at Class.module.exports.Command.extend.run (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\lib\commands\generate.js:77:17)
    at Class.<anonymous> (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\lib\models\command.js:151:17)
    at lib$rsvp$$internal$$tryCatch (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1048:17)
    at c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:331:11
    at lib$rsvp$asap$$flush (c:\temp\app5\node_modules\angular-cli\node_modules\angular-cli\node_modules\rsvp\dist\rsvp.js:1198:9)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
markjritchiecommented, Mar 14, 2016

@Brocco very true, but I thought it might be handy to post for anybody that’s stuck waiting for the next release

1reaction
filipesilvacommented, Mar 17, 2016

@pierreboissinot It’s a windows cmd console specific issue. Which is to say, works on linux and windows with gitbash just fine. We’ll fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 Generate Component error - Stack Overflow
I am trying to create new Component using angular CLI. command : ng generate component myFolder/newComponent But I am getting below error: Error ......
Read more >
ng generate error · Issue #10653 · angular/angular-cli - GitHub
So I think when using ng g c home --project projName, if the projName is not placed under "projects" folder, the generated path...
Read more >
NG8001: Unknown HTML element or component - Angular
If the component is declared in an NgModule (meaning that it is not standalone) make sure that it is exported correctly from it,...
Read more >
ng: command not found (Angular) error [Solved] | bobbyhadz
To solve the error "ng: command not found", install the angular cli package globally by running npm install -g @angular/cli@latest and restart your...
Read more >
Identify and Fix Build and Deployment Errors in Your Angular ...
Many common build errors may occur as a result of rebuilding your app while using ng serve or running ng build or ng...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found