简体   繁体   中英

Missing .angular-cli.json file: Angular

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?

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.

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

mentioned here

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 )

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

angular-cli.json现在已经变为角度6的angular.json

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM