Error creating new component: PriorityQueue is not a constructor

I had a strange error when creating a new component using the Angular CLI, when I used it ng g c navbar, it throws an error:

 core_1.PriorityQueue is not a constructor
TypeError: core_1.PriorityQueue is not a constructor
    at new TaskScheduler (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular-devkit/schematics/src/engine/task.js:20:23)
    at SchematicEngine.createContext (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular-devkit/schematics/src/engine/engine.js:81:31)
    at SchematicImpl.call (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:38)
    at Promise (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular/cli/tasks/schematic-run.js:73:23)
    at new Promise (<anonymous>)
    at Class.run (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular/cli/tasks/schematic-run.js:72:16)
    at Class.run (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular/cli/commands/generate.js:161:33)
    at resolve (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular/cli/ember-cli/lib/models/command.js:261:20)
    at new Promise (<anonymous>)
    at Class.validateAndRun (/home/praveen/Desktop/Angular_Projects/a2website/node_modules/@angular/cli/ember-cli/lib/models/command.js:240:12)


Can someone help me? .. Thanks in advance.

+7
source share
2 answers

In your .json package you will see:

"devDependencies": {
   "@angular-devkit/core": "OLD VERSION",  <----- once you run the command this will update
    ...
 }

The command to start the update:

npm i -D @angular-devkit/core@latest
+21
source

Update your angular cli or make sure you have the latest version of angular cli installed.

To install the latest version of angular cli, use the command:

npm install -g @angular/cli@latest

+2
source

Source: https://habr.com/ru/post/1692679/


All Articles