Error when creating new project with Angular-CLI 6.1.2

不想你离开。 提交于 2019-12-05 14:31:36

问题


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?


回答1:


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




回答2:


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




回答3:


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



回答4:


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




回答5:


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




回答6:


Number at the end also does not work.

I had to change from

ng new Chapter-4

to

ng new Chapter4



来源:https://stackoverflow.com/questions/51690402/error-when-creating-new-project-with-angular-cli-6-1-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!