Today, I updated my angular cli to the latest version and encountered an error that stops me from creating a new Angular project. Following is the error log that I get after
That happened to me, I thought that was a bug I reported it here, it turned out that I had a folder named node_modules on my home directory!
To make sure this is the same issue with you run following commands
npm ls -g @schematics/angular
npm ls @schematics/angular
If the output of second command contains
npm ERR! extraneous: @schematics/angular@0.6.0 C:\Users\User\node_modules\@angular\cli\node_modules\@schematics\angular
then most likely you have the same issue as it appears that there is a node_modules folder with both the CLI and an old version of @schematics/angular installed locally (C:\Users\User). Remove this to fix this issue.
Please check if it is the case for you too.
I suspect that your upgrade of Angular CLI didn't go well. Try to uninstall and re-install it again:
npm uninstall @angular/cli -g
npm install @angular/cli -g
Try uninstall and reinstall it again: npm ls -g @schematics/angular npm ls @schematics/angular
I also got this error when I tried to issue, ng new
I later realized it was as a result of issuing "npm install @angular/cli" which created a node_modules folder, in the directory I was working.
Remove "node_modules" folder, and create your project now with "ng new"
Ps. with the angular 6 upgrade, the ng team must specify that you cant just run "npm install @angular/cli" anywhere you want, but only in the newly created project. I think this is a bit unfair to the newbies to angular
Hope this helps