angularangular-cliangular7

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


I updated the Angular CLI to the latest @angular/cli@7.0.2 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

  • First, to upgrade, I did this:

    npm i -g @angular/cli
    npm i @angular/cli
    

    to install globally and locally. Running an npm audit fix revealed there is a problem with a missing package.json in the npm logs - missing from my root directory! So I created one with the following command in my home directory:

    npm init --yes
    

    for a default one. Now issuing an ng new projName works.