ng build --prod UnhandledPromiseRejectionWarning: Unhandled promise rejection

Viewed 1758

Angular 4.3 I get the following error when trying to ng build --prod

94% asset optimization(node:7184) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token: name (i)

I have no idea where this issue stems from as thats the only error I can find.

4 Answers

Revert the angular CLI version 1.3.2 until this bug gets fixed:

npm install @angular/cli@1.3.2 (add -g if you are using a global package)

You should be able to build now :).

npm install @angular/cli@1.3.2 ( @maximedupre answer ) Also need to have one more step before installing the above command is to open vs code in administrator mode

Related