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
34
votes
5 answers

"Error: No provider for Overlay!"

In my Angular 2.0.0-rc.7 + Angular Material 2.0.0-alpha.8-1 application built with Angular CLI 1.0.0-beta.11-webpack.9-1, I get the following error after upgrading from rc.5+alpha.7-4 (via the 1.0.0-beta.11-webpack.8 NG CLI): main.bundle.js:44545…
Jan Nielsen
  • 10,892
  • 14
  • 65
  • 119
33
votes
4 answers

How should I resolve this error that occurs when using ng new?

I've installed the angular-cli with the command npm install -g @angular/cli. When I try to run the command ng new and create a new project, an error occurs: ⠙ Installing packages (npm)...npm WARN deprecated source-map-resolve@0.6.0: See…
Sipeng He
  • 293
  • 3
  • 5
33
votes
3 answers

get/set have been deprecated in favor of the config command

Using angular-cli at the command line, I executed: ng set defaults.styleExt styl to set the default styling to Stylus and I got this response: get/set have been deprecated in favor of the config command I want to change the style extension on an…
danday74
  • 52,471
  • 49
  • 232
  • 283
33
votes
7 answers

Exclude files from build in Angular 2

How to exclude files from the Angular build using Angular-CLI. I've just added the path to exclude in the tsconfig.json and tsconfig.app.json files, but when I run ng serve, Angular is still trying to compile the files. Any ideas?
Matías González
  • 1,366
  • 3
  • 15
  • 30
33
votes
6 answers

How to get one file as output of angular cli

I'm working on ng2 application and I use @angular/cli to build it. As output it emits several js files like .inline.js, .vendor.js etc. The question is -- how to set up angular-cli to emit only one file as a result, i.e. bundle vendor.js, inline.js…
Leo
  • 1,683
  • 2
  • 20
  • 25
33
votes
12 answers

EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module'

I'm trying to lazy load Angular 2 modules with the router, and I'm having this error: error_handler.js:50 EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module' I tried all the answers that seems to be working for the…
33
votes
6 answers

Run Angular2 as static app in browser without a server

As I understand the Angular2 concept - it is transpiling TypeScript files to .js files. In principle, it should be possible to compile, package, and then run that Angular2 application as a static application from AWS S3 bucket, GitHub or whatever…
Maris
  • 664
  • 1
  • 5
  • 15
32
votes
4 answers

What will happen if sourcemap is set as false in Angular

I'm new in Angular. I saw sourcemap in tsconfig.json and by default it is "sourceMap": true. I had few doubts and found this link useful. Still I have the following doubt regarding the same. I set "sourceMap": false, but couldn't find any change in…
kmg
  • 1,195
  • 3
  • 11
  • 14
32
votes
9 answers

Lazy load Angular 5 error: $$_lazy_route_resource lazy recursive

I'm using angular cli AoT compilation. When I try to make a lazy load component following this tutorial, I got the error below: ERROR Error: Uncaught (in promise): TypeError: __webpack_require__.e is not a function TypeError: __webpack_require__.e…
Radonirina Maminiaina
  • 6,958
  • 4
  • 33
  • 60
32
votes
2 answers

What is the purpose of ng eject?

The documentation is very brief with this topic: ng eject ejects your app and output the proper webpack configuration and scripts What is the purpose of this command?
John-Philip
  • 3,392
  • 2
  • 23
  • 52
32
votes
1 answer

Angular4 APP_INITIALIZER won't delay initialization

Typescript: 2.2.0 Angular: 4.0 I am attempting to ensure that a ConfigService object is initialized before application startup through the use of APP_INITIALIZER. I've found many examples of how to do this however NONE of them seem to be delaying…
DynaWeb
  • 605
  • 1
  • 7
  • 15
32
votes
10 answers

Angular 2 Cannot read property 'config' of null

I have a issue with Angular 2. When i want to start server it get this: $ ng serve Cannot read property 'config' of null TypeError: Cannot read property 'config' of null at Class.run (C:\Users\Damien\Desktop\application\node_modules\@angul…
Damien
  • 351
  • 1
  • 3
  • 5
31
votes
3 answers

Extracting CSS into JS with Angular 11 (deprecated extractCss)

We are using an Angular 11 app to create a web component. For this it is necessary that all styles are bundled inline into a single JS file. Before Angular 11, we used to do this with extractCss: false in then angular.json config. Now this option…
Gregory Bleiker
  • 644
  • 1
  • 7
  • 12
31
votes
7 answers

Unable to get Angular CLI version, though all the requirements are installed?

I am having difficulties doing anything with the Angular CLI. I have Node, NPM. and Angular all installed, when I run the which command in the terminal they all exist in my /user/local/bin This is my current node.js: v11.8.0 This is my current npm:…
Tanner
  • 720
  • 1
  • 8
  • 17
31
votes
1 answer

Angular 6, should I put secret environment variables in environment.ts file?

There are two sub-questions: Should I put secret environment variables in the environment.ts file? The process variable shim is gone. If I use it, tsc will throw an error: Cannot find name 'process'. Here is my thing: About Q1: I don't think put…
Lin Du
  • 88,126
  • 95
  • 281
  • 483