ng new fails with "Schematic input does not validate against the Schema"
Bug Report or Feature Request (mark with an x)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
Command (mark with an x)
- [x ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Versions
Node Version:
$ node --version
v10.12.0
NPM Version:
$ npm --version
6.4.1
Angular Version:
$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 7.0.2
Node: 10.12.0
OS: darwin x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.10.2
@angular-devkit/core 7.0.2
@angular-devkit/schematics 7.0.2
@schematics/angular 7.0.2
@schematics/update 0.10.2
rxjs 6.3.3
typescript 3.1.3
OS: MacOS Mojave
Repro steps
ng new ng7app
The log given by the failure
Schematic input does not validate against the Schema: {"name":"ng7app"} Errors:
Data path "" should have required property 'version'.
Desired functionality
I would like to generate a new Angular Workspace.
Mention any other details that might be useful
if i provide a 'version', then i get a different error :
$ ng new ng7app --version 7
Cannot read property 'entries' of undefined
Hi B1u2Pr0, I'm not sure it does solve the original issue at all. However, it allows a simple typo to be eliminated before getting unrelated 'me toos',
I was facing the same issue... The problem for me was , I was using an underscore when creating the directory name. I was using "ng new Test_Angular". Then I changed it to "ng new Test-Angular" and it worked for me
I had the same error when I used underscores in the new app name instead of hyphens: npm new my_new_app >>> Fails npm new my-new-app >>> Succeeds
So it was the underscores. This worked for me. Thanks! (Still, it's strange)
in my case using @angular/cli 7.2.3
ng new angular-7-test failed with error
Schematic input does not validate against the Schema: {"name":"angular-7-test","version":"7.2.3","routing":true,"style":"scss"}
Errors:
Data path ".name" should match format "html-selector".
ng new angular7testsuccess
@meysamsahragard
npm i @schematics/[email protected] --save-dev
work for me Thanks :)
Hi dear Rajkumar. You're welcome.
@SubbuSwaroop Yes. i faced same issue and it was successful after removing uderscore is there any specific usage for uderscore?
I have the same error creating new project with underscore
ng new angular_wip
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? Sass [ http://sass-lang.com ]
Schematic input does not validate against the Schema: {"name":"angular_wip","version":"7.3.2","routing":true,"style":"sass"}
Errors:
Data path ".name" should match format "html-selector".
Anyway to resolve this? It's ridiculous that the project must not contain underscore in order for the cli to successfully initialize the app.
Angular CLI: 6.2.9 Node: 10.15.1 OS: linux x64 Angular: ...
Package Version
@angular-devkit/architect 0.8.9 @angular-devkit/core 0.8.9 @angular-devkit/schematics 0.8.9 @schematics/angular 0.8.9 @schematics/update 0.8.9 rxjs 6.2.2
Schematic input does not validate against the Schema: {"version":"6.2.9","skipGit":false,"experimentalIvy":false,"skipInstall":false,"linkCli":false,"commit":true,"newProjectRoot":"projects","inlineStyle":false,"inlineTemplate":false,"routing":false,"prefix":"app","style":"css","skipTests":false,"createApplication":true,"minimal":false} Errors:
Data path "" should have required property 'name'.
I removed node_modules folder in users/{user name} and ng new [appname] now working.
Eliminar la carpeta de node_modules funcionó para mí, había quedado un package.json que también lo eliminé.
Angular CLI: 7.3.4 Node: 10.15.2 OS: darwin x64
Apparently if your project name has a "_" or "-" (underscore or hyphen) it tends to throw this error. I removed the special chars and it worked ok.
I had the same error when I used underscores in the new app name instead of hyphens:
npm new my_new_app >>> Fails npm new my-new-app >>> Succeeds
had same issue and using hyphens instead of underscore worked perfectly
have the sane trouble
npm uninstall -g angular-cli npm uninstall -g @angular/cli npm cache clean npm install -g @angular/cli@latest
reinstall helps me
I had this same issue and just had to make it ng new myApp --version 7.3.6 <-the version of angular I am using
Apparently if your project name has a "_" or "-" (underscore or hyphen) it tends to throw this error. I removed the special chars and it worked ok.
🤦♂️ - This worked for me.
Thanks @johnmanoahs
For me, before, I updated npm : "npm update" and after run : "ng new projetc-teste --version=7.3.6"
i'm still facing the same issue.My current angular version is 7.3.6 but error still exist
ng new learn-curve C:\Users\mohan.n\Desktop\My Help in Angular Nov\angular-learn>ng new learn-curve Schematic input does not validate against the Schema: {"name":"learn-curve"} Errors:
Data path "" should have required property 'version'.
i also tried ng new projetc-teste --version=7.3.6 for which i'm getting Cannot read property 'entries' of undefined
Please help me out
@mohanacchu try no to use '-' on the name of the project. Something is wrong with newer versions in that regard
Try inside your project to remove node_module and run npm install again
I had the same error when I used underscores in the new app name instead of hyphens:
npm new my_new_app >>> Fails npm new my-new-app >>> Succeeds
Strange but this actually resolved the schematic issue.