Data path “” should NOT have additional properties

2019-04-02 13:51发布

问题:

I installed latest Angular 6.0.4 in MAC, when I enter in terminal:

ng new happiness

display:

Schematic input does not validate against the Schema: {"dryRun":false,"version":"6.0.4","skipGit":false,"skipInstall":false,"linkCli":false,"commit":true,"newProjectRoot":"projects","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","style":"css","skipTests":false} Errors:Data path "" should NOT have additional properties(dryRun).

Anyone can tell me? Thanks a lot

回答1:

Maybe Angular 6.0.5 version

npm update
npm uninstall -g @angular/cli
npm cache verify
npm install -g @angular/cli@6.0.5
ng new --name my-app

Another thread is same: Issue while ng new app-name angular cli 6.0.4



回答2:

Can you try following:

ng update @angular/cli --migrate-only --from=1.7.4

there was an issue. You can find here.



回答3:

I had the same problem. I was using angular cli version 6.0.4, and it seems like there is some issue with the version. I uninstalled 6.0.4 and installed 6.0.2, and it fixed the problem.



回答4:

I found that this issue with the version 6.0.4 and unfortunately it is still (25-05-2.18 10:59 AM IST) open in github-#11006. So uninstall angular cli and install 6.0.3. Another issue I have found that sh1 checksum error, it will occur when installing new nodejs. (in windows machine) to install new cli

 1. npm uninstall -g @angular/cli
 2. npm install -g @angular/cli@6.0.3
 3. npm cache verify

if you are getting Sha1 and sha512 checksum error then,

If already node installed and you are planning to install new node and new 
cli then uninstall old nodejs then delete the cache manually before 
installing new nodejs (C:\Users\<username>\AppData\Roaming\npm & C:\Users\ 
<username>\AppData\Roaming\npm)

It worked for me



回答5:

Looks like the new 6.0.5 version fixed this issue more info

Unfortunately, due to some issue found after doing the 6.0.4 release, we were forced to rollback. This release is the same as 6.0.3.



回答6:

Looks like the new 6+ version fixed this issue in Mac when we create an angular project after update Angular CLI version.

So run this command:

npm i @schematics/angular@latest --save-dev