51

Trying to get started in Angular, after creating the project in the CLI I tried opening the project using both ng serve -o and npm start but I get the following error:

Schema validation failed with the following errors:
  Data path "" should NOT have additional properties(es5BrowserSupport)

Tried:

  • Recreating the project with similar results
  • Reinstalling the CLI

ErrorLog:

0 info it worked if it ends with ok    1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using npm@6.4.1
3 info using node@v10.15.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle ccctool@0.0.0~prestart: ccctool@0.0.0
6 info lifecycle ccctool@0.0.0~start: ccctool@0.0.0
7 verbose lifecycle ccctool@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle ccctool@0.0.0~start: PATH: C:\ProgramFiles\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\User\Desktop\CCCTool\node_modules\.bin;C:\Program Files (x86)\Razer Chroma SDK\bin;C:\Program Files\Razer Chroma SDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\User\AppData\Roaming\npm;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin
9 verbose lifecycle ccctool@0.0.0~start: CWD: C:\Users\User\Desktop\CCCTool
10 silly lifecycle ccctool@0.0.0~start: Args: [ '/d /s /c', 'ng serve' ]
11 silly lifecycle ccctool@0.0.0~start: Returned: code: 1  signal: null
12 info lifecycle ccctool@0.0.0~start: Failed to exec start script
13 verbose stack Error: ccctool@0.0.0 start: `ng serve`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program 
Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:962:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid ccctool@0.0.0
15 verbose cwd C:\Users\User\Desktop\CCCTool
16 verbose Windows_NT 10.0.17763
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v10.15.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error ccctool@0.0.0 start: `ng serve`
22 error Exit status 1
23 error Failed at the ccctool@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Jeroen
  • 60,696
  • 40
  • 206
  • 339
Frostytude
  • 511
  • 1
  • 4
  • 5

6 Answers6

41

es5BrowserSupport add additional polyfill

Solution 1

For option es5BrowserSupport your @angular/cli required minimum version 7.3 and @angular-devkit/build-angular required minimum version 0.13 .

  1. Check your @angular/cli version. if is less than 7.3 then run following command

    ng update @angular/cli

  2. Check your @angular-devkit/build-angular version. if is less than 0.13 then run following command

    ng update @angular-devkit/build-angular

Solution 2

Also you can edit angular.json file and find "es5BrowserSupport": true and comment it. It will also work without updating dependency

Bhagwat Tupe
  • 1,905
  • 1
  • 13
  • 28
  • 2
    Solution 1 didn't work for me. Solution 2 is not really a solution, as it deactivates the feature to support es5 browsers with a lazyly loaded polyfills bundle. – Rias May 06 '19 at 15:29
  • I was on 0.12 something for `build-angular` and this fixed it. Nothing else out there mentioned this and my `ng update` was telling me 'nothing to update!' so this helped a lot – Simon_Weaver May 11 '19 at 09:17
  • 5
    Solution 2 is the fastest – Danyal Shahid Oct 02 '19 at 13:25
  • Thanks @Danyal for your response – Bhagwat Tupe Oct 02 '19 at 14:58
  • 2
    I agree to solution 2 instead of downgrading – Mia loha.dev May 05 '21 at 16:19
  • I realize this is dated, but I got this error. I have @angular-devkit/build-angular of 12.2.2 and no es5BrowserSupport anywhere in angular.json. – Woodsman Aug 20 '21 at 08:47
  • For the record this type of error can also occur with other params that have changed in the angular.json. I had the same issue with the no longer valid "extractCSS" still being in the file after I upgraded Angular. – Eric Soyke Sep 25 '22 at 18:35
28

Install @angular/cli@7.3.0 and @angular-devkit/build-angular@0.13.0 to support es5BrowserSupport option in angular.json

Rakhat
  • 4,783
  • 4
  • 40
  • 50
  • That's how it worked for me as well. Looks like @angular-devkit/build-angular was not updated when update cli to newer version. – Michael Warneke Feb 08 '19 at 07:08
  • 3
    In angular.json Angular did add the prop `es5BrowserSupport` (https://blog.ninja-squad.com/2019/01/31/angular-cli-7.3/). You could remove the prop from your angular.json, or make sure all npm packages which contains the json schema for angular.json are up to date. For me this means also update the `@angular-builders/custom-webpack` The error message really sucks :( – Stefan van de Vooren Feb 13 '19 at 19:29
18

I ran into the same issue after adding a new application to an existing workspace. After some research, I realized that what the error was trying to tell me is that I had an unsupported option in my angular.json, in this instance, the 'es5BrowserSupport' option. After doing a search through my angular.json, and removing the 'es5BroswerSupport' option from the applications architect/Build/options section, I was able to build and serve the application.
I have Angular 7.2.3 with cli 7.3.

Craig H
  • 191
  • 3
3

I received this error after manually adding a new application in angular.json. The application configurations need to be inside the "projects". This error occurred when I added new application outside of the enclosing bracket of projects.

Atif Majeed
  • 1,021
  • 17
  • 14
1

before updating delete package-lock.json and delete node_modules

then fix it by updating

"@angular-devkit/build-angular": "~0.802.2" 

My angular Version : 8

My Ionic Version : 4

i hope help you !

0

I fixed it by updating my @angular-devkit/build-angular to 0.13.5