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?

7 Answers 7

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

Sign up to request clarification or add additional context in comments.

2 Comments

yes, thank you. I did't know I wasn't allowed to use numbers when creating a new angular project in angular-cli 6.1.2. It was allowed in earlier versions though.
You can still use numbers, just not lone numbers.
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

4 Comments

Well I'm not using underscore and dashes works fine.
I spent 1 hour the other day , before I realize that I was using underscores. :)
Yeah, thanks for sharing the info man but we should edit your answer a bit. This would be helpful for others that will encounter this error with Angular 6.
Yes thank you Sherwin , it looks better now.I post this answer because a lot of guys like me writing c and c++ , have the habbit to give snakecase names in files , functions , project etc.
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

1 Comment

Thanks for the info. I didn't know this could work too
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

Comments

1

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

Comments

0

Number at the end also does not work.

I had to change from

ng new Chapter-4

to

ng new Chapter4

Comments

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

3 Comments

Actually Angular encourages to add dashes, see their setup guide. Also in general it is possible to use numbers, expect for some special cases. So this answer is quite inaccurate.
Adding dashes never worked for me.
I use dashes all the time and they work for me in 95% of the cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.