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
For me, before, I updated npm : "npm update" and after run : "ng new projetc-teste --version=7.3.6"
Thanks, this worked for me.
3 things you should check if you face problem on ng new
- check the directory name - should not have alphanumeric and special characters.
- type ng --version in node cmd, check whether all package is clear without showing error on the package version or else install those packages.
- if cmd shows error on @angular\cli then delete c:\users\username\Appdata\Roaming\npm\node_modules@angular\cli and then install it, it will work. if you feel appdata is missing in the folder then it is in hidden, u should do C: -> Organize -> Folder Options -> View -> Hidden files and folder -> Show hidden files.....
Hope this will help you....
3 things you should check if you face problem on ng new
- check the directory name - should not have alphanumeric and special characters.
- type ng --version in node cmd, check whether all package is clear without showing error on the package version or else install those packages.
- if cmd shows error on @angular\cli then delete c:\users\username\Appdata\Roaming\npm\node_modules@angular\cli and then install it, it will work. if you feel appdata is missing in the folder then it is in hidden, u should do C: -> Organize -> Folder Options -> View -> Hidden files and folder -> Show hidden files.....
Hope this will help you....
mine had alphanumeric. Removed the number and now its working. Ty
HI, This issue may be resolved by applying the following command in cmd.
npm i @schematics/angular@latest --save-dev
after applying this no need to write version after angular 7 project name just write ng new ang-project-name
I deleted the -3 at the end of my project name and then it worked. :)
ng new my-project-3 ----> Doesn't work ng new my-project-three ----> Works
It seems the CLI doesn't like project names that end with a dash/underscore and only digits (e.g app-name-01, app-name_02). Removing the dash/underscore works, ie. app-name01, app-name02.
For me, helped removing ~/package-lock.json (who knows why that file was in my home)
use --clientProject project-name flag work for me
previous CLI version:-- 7.3.8 solution:-- updated CLI version to the latest use CLI version:- 7.3.9 work for me
In my case i had an app anem like abc-2-xyz. Changing it to abc2xyz resolved the problem.
I was getting this error when I had an underscore sign in my project name. Worked normally after removing it.
Angular CLI: 7.3.8
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
this one worked fine for me. Thanks.
Resolved as follows:-
npm uninstall -g @angular/cli npm uninstall @angular/cli npm cache verify npm install -g @angular/cli@next npm install @angular/cli@next npm i @schematics/angular@next
first type ng -v then according to your version install following command @schematics/[email protected]
I had the same problem with ng new naq_monthly_settlement_report. I fixed it with ng new naq-monthly-settlement-report
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.