49

I've created Angular2 project using Angular-cli with the following command:

ng new project-name

but, I don't see .angular-cli.json file in my root folder of the project. The angular-cli version I'm using is 1.0.2. I've created multiple projects with cli in the past and have never encountered this problem. Is it because of the recent update? If yes, where can I find the json file? Or do I need to create it manually?

Aiguo
  • 3,416
  • 7
  • 27
  • 52
  • what happens if you try to run `locate angular-cli.json`? – Mike Tung May 06 '17 at 19:32
  • "Don't see" in what sense? What happens when you run `ng serve`? –  May 06 '17 at 19:38
  • @torazaburo ng serve works fine! I'm able to use all the cli commands, but can't locate the angular-cli.json file in the root directory. I did 'locate angular-cli.json' and got the following path: /usr/local/lib/node_modules/@angular/cli/blueprints/ng/files/angular-cli.json – Aiguo May 06 '17 at 19:48
  • 3
    Files starting with a dot are hidden files on Unix-like systems. execute `ls -a` in the root folder, and you'll see it. – JB Nizet May 06 '17 at 21:53

6 Answers6

103

Update: With Angular 6.0.0 the filename is changed from .angular-cli.json to angular.json.

.angular-cli.json is a hidden file since @angular/cli version 1.0.

The file got the prefix . with this version 1.0 , so it is hidden as @JB Nizet commented.

The change is described in the wiki of @angular/cli stories 1.0 update

The location of this file is unchanged.

When you create a new project with @angular/cli 1.0.2, the message

create .angular-cli.json

is displayed.

Marc
  • 1,300
  • 1
  • 10
  • 15
  • But how can I run the project developed in previous versions via latest angular-cli ?? – Lalit Kushwah Jul 04 '18 at 13:29
  • please see https://blog.angular.io/version-6-of-angular-now-available-cc56b0efa7a4 with https://update.angular.io/ Update Guide – Marc Jul 04 '18 at 14:11
  • I tried to rename my angular-cli.json with angular.json it didnt work for me.. it is throwing and error in the same package. PS : I have migrated my application from angular 5 to angular 6.. afte Migration i am getting error as "Error: Local workspace file ('angular.json') could not be found" – Bhushan Khaladkar Nov 30 '21 at 05:23
44

angular-cli.json file has been renamed/replaced to angular.json from version 6.0.

mentioned here

Nitin Jadhav
  • 6,495
  • 1
  • 46
  • 48
  • this is important to know for everybody who can not find it! thanks – Arrie May 19 '20 at 15:48
  • I tried to rename my angular-cli.json with angular.json it didnt work for me.. it is throwing and error in the same package. PS : I have migrated my application from angular 5 to angular 6.. afte Migration i am getting error as "Error: Local workspace file ('angular.json') could not be found" – Bhushan Khaladkar Nov 30 '21 at 05:22
2

I also somehow created an angular project that didn't have a .angular-cli/json file, but that otherwise appeared to build and test successfully.

Turns out that I created it by cloning the quickstart from GitHub using the instructions here: https://angular.io/guide/setup

If you install the full CLI, then it will generate projects that contain the missing file. Use npm install -g @angular/cli, per https://angular.io/guide/quickstart

Evan Wieland
  • 1,445
  • 1
  • 20
  • 36
D. Huntley
  • 21
  • 2
2

You will not see angular-cli.json instead you see this (with dot at the beginning) .angular-cli.json which is hidden file. On finder MAC OS go to the project root folder and do

command + shift + .

or on eclipse open the project in navigator

Window->Show View->Navigator

and

Eclipse -> Preferences -> Remote Systems -> Files: Check the "Show hidden files" Ok.

That way you could display or hide hidden file like (.git, .gitIgnore)

Tadele Ayelegn
  • 4,126
  • 1
  • 35
  • 30
1

angular-cli.json has now been changed to angular.json on angular 6

shalamus
  • 2,192
  • 1
  • 12
  • 8
0

Click on ‘View Menu’ in the Project Explorer view and select ‘Filter(sts) / Customize View(eclipse)’. Uncheck the .*resources filter and you will now be able to see the .angular-cli.json in the project structure.

prasanth
  • 119
  • 1
  • 10