Angular-cli v.6 new project build failed?

482 Views Asked by At

I installed Angular CLI v.6. Then I create a new project.

npm install -g @angualr-cli@^6.0.0
ng new my-app
cd my-app
npm install
npm build

The build fails with the following error.

chunk {main} main.js, main.js.map (main) 604 bytes [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 659 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 15.6 kB [initial] [rendered]

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

Thanks.


Update: The angular cli version:

ng version

Angular CLI: 6.0.8
Node: 10.15.3
OS: win32 x64
Angular: 6.1.10

Update: npm install -g @angular/cli@^6.0.0 deos not install the latest verison

npm install -g @angular/cli@"<7.0.0" will install the latest version v.6. The problem sovled after install the latest Angular-cli v.6.2.9

2

There are 2 best solutions below

0
Lalith Katta On

Try rm -rf node_modules/ and npm install inside of my-app

0
Abhishek Gautam On

1.Uninstall the current angular cli. npm uninstall @angular/cli

2.Delete the folder : enter image description here.

enter image description here

3.Delete the temp file of node_module if any exist, using %AppData%\npm-cache in cmd.

4.Restart the system.

5.Give fresh install with npm install @angular/cli@ eg: 6.0.2

Done your are good to go. :)