Questions tagged [angular-cli]

The Angular CLI is a command line interface for building, managing and deploying Angular (version 2+) applications.

The Angular CLI is a command line interface for building, managing and deploying Angular (version 2+) applications. It can be used to generate part of the application, serving in a local server, analysing code quality, etc. It is based on ember-cli project.

Installation

npm install -g @angular/cli

Usage

ng help

Generating and serving an Angular project via a development server

ng new PROJECT-NAME
cd PROJECT-NAME
ng serve

For more information, please visit the following links.

7329 questions
51
votes
2 answers

Is not core-js needed anymore?

I've updated an Angular project from version 7 to 8. Everything runs smoothly, schematics did it's job (maybe) and we are Ok (project is even in production). When we're updating Angular CLI, we always generate a new project to see the real…
Daniel Díaz Astudillo
  • 1,622
  • 2
  • 14
  • 14
51
votes
6 answers

Data path '''' should NOT have additional properties (es5BrowserSupport)

Trying to get started in Angular, after creating the project in the CLI I tried opening the project using both ng serve -o and npm start but I get the following error: Schema validation failed with the following errors: Data path "" should NOT…
Frostytude
  • 511
  • 1
  • 4
  • 5
51
votes
11 answers

The command "npm run build -- --prod" exited with code 1 error

I'm developing an Asp.Net Core 2 and Angular 5 project in visual studio 2017. When I'm going to publish my project then the error 'The command "npm run build -- --prod" exited with code 1' show in error list window. I created the project with…
Iman Bahrampour
  • 6,180
  • 2
  • 41
  • 64
51
votes
4 answers

ng generate component in subdirectory

I have the following directory structure I would like to create a new page, let's say, an About page. I want to put it in src/app/page/about/* So I try: ng generate component pages/about but I get this error: Error: More than one module matches.…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
51
votes
2 answers

Angular CLI - Please add a @NgModule annotation when using latest

note: I'm new to Angular, so please excuse any new comer stupidity here. Details I've installed the latest version of Angular CLI The default app loads and runs perfectly fine after 'ng serve' Issue I decided to create a new module an import it…
MegaTron
  • 3,133
  • 6
  • 28
  • 45
50
votes
13 answers

Unexpected token '.' when trying to run 'npm install'

I am trying to install the angular cli with 'npm install -g @angular/cli' and I am met with the following error: npm ERR! Unexpected token '.' npm ERR! A complete log of this run can be found in: npm ERR! …
Thomas Stout
  • 503
  • 1
  • 4
  • 8
50
votes
6 answers

'rootDir' is expected to contain all source files

I have an Angular CLI workspace containing two library projects, foo and bar. When I build the second of the two libraries, foo, the build fails with the following error: error TS6059: File '/code/projects/bar/src/lib/types.ts' is not under …
Sam Herrmann
  • 6,293
  • 4
  • 31
  • 50
50
votes
19 answers

Cannot find module @angular\cli\bin\ng

I'm getting into trouble with anngular-cli installation because it doesn't recognize the ng command in my git bash but it works in my cmd on Windows 7. I looked for some issues on the web but I didn't really find a solution. Here, the error : ng…
Romain Rnd
  • 501
  • 1
  • 4
  • 7
50
votes
4 answers

Angular No module factory available for dependency type: ContextElementDependency

Running ng build on my Angular 4 project give this error : 14% building modules 40/46 modules 6 active ...es\@angular\http\@angular\http.es5.js An error occured during the build: Error: No module factory available for dependency type:…
komron
  • 2,267
  • 2
  • 17
  • 26
50
votes
9 answers

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

I have installed Angular CLI package separately using npm: npm install --save-dev @angular/cli@latest When I try to use commands cli I get an error: Unable to find any apps in `.angular-cli.json`. How to generate .angular-cli.json for current…
POV
  • 11,293
  • 34
  • 107
  • 201
50
votes
22 answers

Angular2 CLI error "@angular/compiler-cli" package was not properly installed

I'm working an Angular 2 project. Now trying to install Angular CLI within the current project with the following npm install --save-dev @angular/cli@latest npm install Problem is when running ng serve I receive error The "@angular/compiler-cli"…
BrrBr
  • 965
  • 1
  • 8
  • 16
50
votes
2 answers

angular cli exclude files/directory for `ng test --code-coverage`

I am running the following command to unit test and generate code code coverage report. ng test --code-coverage It is working fine and writing code coverage report in coverage folder. In this I got all files and directory coverage report But I…
Partha Sarathi Ghosh
  • 10,936
  • 20
  • 59
  • 84
49
votes
6 answers

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…
Aiguo
  • 3,416
  • 7
  • 27
  • 52
49
votes
6 answers

How to debug angular app using angular-cli webpack?

I used angular-cli@1.0.0-beta.10 before and now I updated to angular-cli@webpack beta.11. After a lot of custom changes I got it to work. The only thing is that now I can not debug my angular app using webstorm and chrome debugger because I don't…
48
votes
12 answers

You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser after Angular 12 update

After updating from Angular 11 to 12, ng serve is now throwing an error: Error: /Users/btaylor/work/angular-apps/mdsl-authoring/assets/scss/_colors.scss:1:4: Unknown word You tried to parse SCSS with the standard CSS parser; try again with the…
Brandon Taylor
  • 33,823
  • 15
  • 104
  • 144