17

I tried creating a new Angular project using ng new angular-6-boilerplate but I can't do it anymore with angular-cli latest version. I'm using terminal for windows to create my project but I got this error.

Schematic input does not validate against the Schema: {"name":"angular-6-boilerplate","version":"6.1.2","newProjectRoot":"projects","skipInstall":false,"linkCli":false,"skipGit":false,"commit":null} Errors:

  Data path ".name" should match format "html-selector".

Why am I getting this error?

Melchia
  • 22,578
  • 22
  • 103
  • 117

7 Answers7

37

Do not include project name special characters or numbers. Try the following:

$ ng new angular-boilerplate

I did some research & found out that this comes from the schema responsible of creating new Angular applications Link Here

Melchia
  • 22,578
  • 22
  • 103
  • 117
15

No Snakecase.

Watch out for underscores as well (not just lone numbers).

ng new my_fantastic_app

Is an invalid name.

And of course as other people have already say , be careful for Lone numbers between dashes

7

Melchia is correct.

But to be more specific, the problem is the lone number between the dashes.

This will also work:

ng new angular6-boilerplate
Todd Palmer
  • 1,002
  • 10
  • 20
2

Don't use _ (underscore) sign, use minus - (minus) sign.

For Example:

Wrong code:

ng new naytiv_admin_fe

Right code:

ng new naytiv-admin-fe

Karar Barcha
  • 406
  • 4
  • 11
1

Do not include any special characters. You can use the hyphen ( - ) instead of it.

Ganesh Mulay
  • 161
  • 2
  • 15
0

Number at the end also does not work.

I had to change from

ng new Chapter-4

to

ng new Chapter4

Rajat
  • 410
  • 4
  • 19
0

Try to avoid numbers and special characters while giving name of new project of angular. ng new angular-6-boilerplate Changed to --> ng new angulaBoilerplate

  • Actually Angular encourages to add dashes, see their [setup guide](https://angular.io/guide/setup-local#create-a-workspace-and-initial-application). Also in general it is possible to use numbers, expect for some special cases. So this answer is quite inaccurate. – JSON Derulo Apr 28 '23 at 14:17
  • Adding dashes never worked for me. – charu dhingra May 04 '23 at 06:12
  • I use dashes all the time and they work for me in 95% of the cases. – JSON Derulo May 04 '23 at 06:16