'Schematic input does not validate against the Schema: {"name":"testng7"} on Angular 7

I updated the Angular CLI to the latest @angular/[email protected] on a Mac OS. When issuing the command ng new testng7, I get this error:

Schematic input does not validate against the Schema: {"name":"testng7"}
Errors:
  Data path "" should have required property 'version'.

And nothing is created. Any clues how to fix?



Solution 1:[1]

This error is possible of avoiding naming standards

Project name can not have underscore '_'. It can have dashes '-', small and capital letters and digits.

Valid Project Names

myProject //camel casing style or JavaScript style

MyProject //normal style

MyProject1 //letters and numbers mixed style

My-Project1 //letters, numbers and dash mixed style

Invalid Project Names

MyProject-1 //dash can not be between letter and digit

My_Project //underscore is restricted

Solution 2:[2]

I added this flag to make it work --client-project

ng add @nguniversal/express-engine --client-project=launcher

Solution 3:[3]

I was having the same problem

Schematic input does not validate against the Schema: {"name":"DemoProj"}

Errors:

Data path "" should have required property 'version'.

do the following steps to resolve this issue

1) uninstall -g angular-cli

2) npm uninstall --save-dev angular-cli

3) npm install -g @angular/cli@latest

4) npm install --save-dev @angular/cli@latest

5) npm install -g

6) ng new YourProjectName

i hope it will work

Solution 4:[4]

Try the

ng new projectName

cmd in powershell with admin rights. I did it once and after that it works in normal cmd promt too.

Solution 5:[5]

Try

ng new testng7 --version=7.0.2

It Will Work!!!

Solution 6:[6]

none of the solutions helped me or does not deal with the root cause. I found this in my angular.json

  "schematics": {
"@schematics/angular:component": {
  "styletext": "scss"
 }
}

Also my IDE was showing styletext property was not allowed. So I changed the above to this and it works.

    "@schematics/angular:component": {
      "skipTests": true
    }
  }

Solution 7:[7]

Sometimes can be caused by wrong 'global' version of ng.

Try

npx ng generate component MyComponent

That will use 'local' ng installed into node_modules of project

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Omar
Solution 3 Muhammad Tayyab
Solution 4 rahulxyz
Solution 5 Saumyajit
Solution 6
Solution 7 Andrey