Angular: ng new error when I create an angular project
NickName:David Ask DateTime:2018-11-18T01:55:36

Angular: ng new error when I create an angular project

I have this error using ng new project_name:

An invalid configuration file was found ['angular.json']. Please delete the file before running the command.

I am getting this error I don't know how to get the solution.

I uninstalled @angular/cli and installed again

npm clean cache doesnt work too (I dont know if it is problem of my npm version

npm version is 6.4.1    
node version is 8.11.1

what do i need to solve the problem?

Copyright Notice:Content Author:「David」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53353955/angular-ng-new-error-when-i-create-an-angular-project

Answers
pzaenger 2018-11-17T17:57:40

The problem seems to be the _ in project_name resulting in the following error:\n\nSchematic input does not validate against the Schema: {\"name\":\"project_name\",\"version\":\"6.0.1\",\"newProjectRoot\":\"projects\",\"skipInstall\":false,\"linkCli\":false,\"skipGit\":false,\"commit\":null}\nErrors:\n\n Data path \".name\" should match format \"html-selector\".\n\n\nReplace _ e.g. with -.\n\nFurther readings:\n\n\nError when creating new project with Angular-CLI 6.1.2\nStyle Guide\n",


Stefan 2020-03-12T05:07:29

Setting the working directory in IntelliJ's Karma task, to the Angular project's main directory, also fixes the problem.",


David 2018-11-24T16:31:42

I deleted the file in c:\\users\\XXX\\.angular.json and it was running ok.",


shivam mishra 2019-04-22T11:06:26

Run following if file is hidden. Open Terminal, run mv /Users/shivammishra/.angular.json /Users/shivammishra/angular.json.txt. \nmv command will move the file to new location (angular.json.txt) and you can then delete.",


Aashman Thing 2020-08-02T11:04:41

If you are using the terminal of IntelliJ IDEA while there is a angular project already imported in the IDEA, it is the problem of the IDEA.So, open the command promt of your windows and create the project.\nI did this and I was able to create the project.",


More about “Angular: ng new error when I create an angular project” related questions

Angular: ng new error when I create an angular project

I have this error using ng new project_name: An invalid configuration file was found ['angular.json']. Please delete the file before running the command. I am getting this error I don't know how ...

Show Detail

Angular: ng error when I create an angular project in git-bash

I Create a folder and run git-bash command there $ ng new ng_course Actually i tried this first time and it works. But i delete the files when this command downloaded various files. And then i ru...

Show Detail

Cannot create a new Angular project on a Mac

I'm trying to create a new Angular project named 'test' on a Mac. When I use Terminal to create a new project using: xxxx$ ng new test I get the following error message: -bash: /Users/xxxx/.npm-

Show Detail

Error @angular-devkit when creating new project with angular/cli

I can't create new project with my @angular/cli ng new command everytime I run ng new PROJECT_NAME, it gives me this error npm ERR! path D:\angular\project\node_modules\@angular-devkit\build-opti...

Show Detail

Creating a new angular project with ng new

When I try to create a new Angular 4 project with 'ng new myProject', the project folder, sub folders and files are created, but I also always get these errors: npm ERR! path c:\projects\hello-wo...

Show Detail

Error when creating new Nativescript and Angular shared project

I'm trying to create a new project of Nativescript using the shared project option. However, as soon as I run ng new I have this error on the terminal: An unhandled exception occurred: NOT SUPPORT...

Show Detail

ng command not found angular-cli when create new project in windows

i am successfully install node.js and angularjs2 using this command. node version is node version v6.9.1 npm install -g angular-cli and the installation path is that C:\Users\Arobil\AppData\R...

Show Detail

@angular/cli: ng new angular, error angular cli unknown option --silent

I am trying to create a new angular cli project but it shows me error when I am creating one with ng new project $ng new project create project/README.md (1023 bytes) create project/.angular...

Show Detail

Error from `ng serve` after running `ng update @angular/cli @angular/core` and unable to serve Angular project

In my Angular project, I was having errors while trying to build a docker image. I used ng update @angular/cli @angular/core and was able to resolve that error, and now I'm able to create a docker

Show Detail

ng: command not found while creating new project using angular-cli

Installed angular-cli globally using (npm install -g angular-cli) but when I'm trying to create project using ng new my-project it is throwing error: ng: command not found

Show Detail