0
votes

I am trying to set up angular project from scratch.

Below are the steps followed

  • Installed Node js
  • Installed Angular CLI using npm install -g @angular/cli@latest

    Versions Angular CLI: 9.1.4 Node: 12.16.3 OS: win32 x64

    Angular: ... Ivy Workspace:

    Package Version

    @angular-devkit/architect 0.901.4 @angular-devkit/core 9.1.4 @angular-devkit/schematics 9.1.4 @schematics/angular 9.1.4 @schematics/update 0.901.4 rxjs 6.5.4

Created a new app using ng new app_name
While trying to run the app through command ng serve I am getting a host of errors and app is not starting up

Have attached screen shot of the errorenter image description here

1
I recreated your steps, and the problems is that you installing the latest version of angular. You should have used : npm install -g @angular/cliEdwinS95
@EdwinSilva I had tried that and the CLI is version 9.1.4 but when you call "ng new <projectname>" it made projects with 9.1.5 by default. I had even done complete uninstalls of node/npm etc The issue occurs even on completely fresh installs of nodeJS/npm/angularMatt
You have to uninstall angularEdwinS95
@EdwinSilva It is because its a bug - its recommended to rollback as per my answer: github.com/angular/angular/issues/36993Matt

1 Answers

0
votes

edit

If you use angular 9.1.6 it should be fine now

npm update @angular/cli @angular/core

original post

I had the same problem after making a fresh project using

npm install -g @angular/cli
ng new <projectname>

I believe its a bug in 9.1.5 Angular when using the 9.1.4 cli

You'll see the issue when you do

ng --version

if you get:

Angular CLI: 9.1.4
Node: 12.16.3
OS: win32 x64

Angular: 9.1.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

To resolve you install 9.1.4 Angular instead by running after you've done your

ng new <projectname> 

then run

npm install @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected] @angular/[email protected]

ng build

See my other answer for reference

ERROR in TypeError: Cannot read property 'flags' of undefined