How to generate .angular-cli.json file in Angular Cli?

前端 未结 9 2228
情深已故
情深已故 2020-12-04 23:57

I have installed Angular CLI package separately using npm:

npm install --save-dev @angular/cli@latest

When I try to use commands cli<

相关标签:
9条回答
  • 2020-12-05 00:19

    I found similar error it was located to C:\Users\sony\AppData\Roaming\npm\node_modules\@angular\cli\node_modules\@schematics\angular\workspace\files

    it is installed in windows try to search in c drive angular.json you will view the file

    0 讨论(0)
  • 2020-12-05 00:20

    If you copy paste your project the .angular-cli.json you wil not find this file try to create a new file with the same name and add the code and it wil work.

    0 讨论(0)
  • 2020-12-05 00:22

    As far as I know Angular-cli file can't be created via a command like Package-lock file, If you want to create it, you have to do it manually.

    1. You can type ng new to create a new angular project

    2. Locate its .angular-cli.json file

    3. Copy all its content

    4. Create a folder in your original project, and name it .angular-cli.json

    5. Paste what copied from new project in newly created angular cli file of original project.

    6. Locate this line in angular cli file you created, and change the name field to original project's name. You can find the project name in package.json file

    project": {
      "name": "<name of the project>"
    },
    

    However, in newer angular version now it uses angular.json instead of angular-cli.json.

    0 讨论(0)
提交回复
热议问题