angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.97k forks source link

Cannot read property NullLogger or dasherize of undefined #9662

Closed dwilson14 closed 6 years ago

dwilson14 commented 6 years ago

Versions

<!--
Output from: `ng --version`.
@angular/animations: 5.2.5
@angular/cli: 1.6.1
@angular/compiler-cli: 5.2.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.17
typescript: 2.7.1
webpack-concat-plugin: 2.4.2
webpack-dev-server: 2.7.1
webpack: 3.10.0
node: 8.6.0
npm: 5.3.0
Windows10

Repro steps

using ng g c get error first 'Cannot read property 'NullLogger' of undefined. and I have two versions of webpack, both the same (3.10.0) one under the CLI and one not. When I address that issue I get ERROR: cannot read property 'dasherize' of undefined.

Observed behavior

    at SchematicEngine.createContext (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\engine.js:75:38)
    at SchematicImpl.call (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\node_modules\@angular-devkit\schematics\src\engine\schematic.js:35:38)
    at Promise (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\tasks\schematic-run.js:73:23)
    at Promise (<anonymous>)
    at Class.run (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\tasks\schematic-run.js:72:16)
    at Class.run (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\commands\generate.js:161:33)
    at resolve (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
    at Promise (<anonymous>)
    at Class.validateAndRun (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
    at Promise.resolve.then.then (C:\Code\Repos\Physician Links\Web\PhysicianLinks.Application\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)

Desired behavior

would like to be able to create component using cli

Mention any other details that might be useful (optional)

dwilson14 commented 6 years ago

resolved that issue with a lot of uninstalling and re-installing and only issue remaining is when running ng generate component get error 'cannot read property 'dasherize' of undefined. Any direction would be helpful; there seems to be nothing about this out on stack

Jackysi commented 6 years ago

How did you fix this? i have same issue and tried to reinstall stuff 2x and still same issue...
Error: Cannot read property 'dasherize' of undefined

dwilson14 commented 6 years ago

Sorry Jackysi, I inadvertantly closed this but did not resolve the issue.

ekstremedia commented 6 years ago

I have the same issue:

Angular CLI: 1.7.0 Node: 8.9.0 OS: win32 x64 Angular: 5.2.5 ... animations, common, compiler, compiler-cli, core, forms ... http, platform-browser, platform-browser-dynamic, router

@angular/cdk: 5.2.1 @angular/cli: 1.7.0 @angular/language-service: 4.4.6 @angular/material: 5.2.1 @ angular-devkit/build-optimizer: 0.3.1 @ angular-devkit/core: 0.0.25 @ angular-devkit/schematics: 0.0.46 @ ngtools/json-schema: 1.2.0 @ ngtools/webpack: 1.10.0 @ schematics/angular: 0.3.1 @ schematics/package-update: 0.3.1 @ schematics/schematics: 0.0.13 typescript: 2.7.2 webpack: 3.11.0

$ ng g c test Error: Cannot read property 'dasherize' of undefined Cannot read property 'dasherize' of undefined

manubermu commented 6 years ago

I have the same problem. I try to reinstall and and still same issue.

Jackysi commented 6 years ago

I solved it yesterday by running: npm install --save @angular/cli@latest

bulkasamurai commented 6 years ago

I have the same issue Angular CLI: 1.7.0 Node: 8.9.4 Angular: 5.2.5 @angular/cli: 1.7.0

rathodmitesh916 commented 6 years ago

I am running into similar issue.

First, to get ride of below error, I changed @angular-devkit/core from 0.0.27 to 0.0.29.

core_1.PriorityQueue is not a constructor
TypeError: core_1.PriorityQueue is not a constructor
    at new TaskScheduler (/work/tionodeweb/node_modules/@angular-devkit/schematics/src/engine/task.js:20:23)
    at SchematicEngine.createContext (/work/tionodeweb/node_modules/@angular-devkit/schematics/src/engine/engine.js:102:31)
    at SchematicImpl.call (/work/tionodeweb/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:38)
    at Promise (/work/tionodeweb/node_modules/@angular/cli/tasks/schematic-run.js:80:23)
    at Class.run (/work/tionodeweb/node_modules/@angular/cli/tasks/schematic-run.js:79:16)
    at Class.run (/work/tionodeweb/node_modules/@angular/cli/commands/generate.js:173:33)
    at resolve (/work/tionodeweb/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at Class.validateAndRun (/work/tionodeweb/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)
    at Promise.resolve.then.then (/work/tionodeweb/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:140:24)

I resolved that but now have below error on ng generate component unit-testing-example

Error: Cannot read property 'dasherize' of undefined
Cannot read property 'dasherize' of undefined

I tried to update angular cli to latest 1.7.0 but it doesnt help.

OrganicCat commented 6 years ago

I'm getting the same thing right now.

(ran this) ng g c cats/component-palico

Error: Cannot read property 'dasherize' of undefined
JakobSegerslatt commented 6 years ago

I fixed it by updating;

@ angular-devkit/core from "0.0.23" to "0.4.2"

@ angular-devkit/schematics from"0.0.42" to "0.4.2"

ekstremedia commented 6 years ago

When its like @JakobSegerslatt says in package.json,

  "dependencies": {
    "@angular-devkit/core": "^0.4.2",
    "@angular-devkit/schematics": "^0.4.2",
}

it now works again. Thanks.

ngolforoushan commented 6 years ago

npm install --save @angular/cli@latest

Fixed the issue. Thanks Jackysi!

jai-rathore commented 6 years ago

npm uninstall -g @angular/cli npm install -g @angular/cli@latest npm install --save @angular/cli@latest

cmckni3 commented 6 years ago

I had to go back to ng cli version 1.3.2 because I wanted to generate an Angular v4 project.

Prashanth-Thomas commented 6 years ago

I had a similar issue, i solved it by adding the following dependency

npm install @angular-devkit/core@0.0.29

the version number may vary, but i assume it should be enough.

bluelightning2k commented 6 years ago

This did not fix the issue for me. Seen so many errors related to Angular different package versions - it's literally every couple of weeks for every Angular user.

These issue like halve the satisfaction of the average user.

Villanuevand commented 6 years ago

@jai-rathore this work fine for me...

thanks a lot.

tranthaihoang commented 6 years ago

npm i -D @angular-devkit/core@0.4.2 This work for me! tks JakobSegerslatt

NabinKhatiwada commented 6 years ago

thanks @ekstremedia ..

npm i --save-dev @angular-devkit/core@latest
npm i --save-dev @angular-devkit/schematics@latest
oushuintern commented 6 years ago

tks NabinKhatiwada,these work fine for me

Reactman commented 6 years ago

thanks @JakobSegerslatt , it work for me!

ppenan commented 6 years ago

I got the same error with this version con agular/cli, but I need this version, and I don´t new the latest version of cli. How to fix this, any ideas without upgrading the cli verison?

@angular/cli: 1.4.7 node: 8.11.2 os: win32 x64

alan-agius4 commented 6 years ago

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

angular-automatic-lock-bot[bot] commented 5 years ago

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.