Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating New Component throws error:PriorityQueue is not a constructor

I got a weird error while creating new component using Angular CLI,when I used ng g c navbar it throws 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 anyone help me?.Thanks in advance.

like image 673
Praveen Ojha Avatar asked Jan 25 '18 03:01

Praveen Ojha


2 Answers

In your package.json you will see:

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

Command to run the update:

npm i -D @angular-devkit/core@latest
like image 99
Sonja Avatar answered Oct 15 '22 11:10

Sonja


Update your angular cli or make sure you are running the latest version of angular cli.

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

npm install -g @angular/cli@latest

like image 21
techasutos Avatar answered Oct 15 '22 12:10

techasutos