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
39
votes
2 answers

Clear angular cache in .angular folder

From version 13.0.0 there will be a .angular folder generated in root which is ignored by git containing a cache folder which caches builds. How can I remove (or clear) this cache?
Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
39
votes
9 answers

How to add external js file in angular 6 library

I am creating an angular library (version 6) which is based on angular material for which I need to include the hammer js library. I know that in angular 6 we can add the external js library in the angular.json under the project's configuration.…
nikhil
  • 823
  • 1
  • 7
  • 19
39
votes
3 answers

Angular CLI 6 Unknown option: '--singleRun'

When I want to execute my tests, I used to have the option --single-run activated, but after upgrading to Angular 6 it is not recognized anymore. > ng test --source-map=false --single-run --no-progress --browsers=ChromeNoSandbox Unknown option:…
mrkernelpanic
  • 4,268
  • 4
  • 28
  • 52
39
votes
4 answers

How to upgrade minor version of angular using angular cli

This is a simple question but I'm struggling to find the answer via Google... I have an angular 4 project (created using angular cli) and would like to make use of http interceptors that have just been released in 4.3. How do I upgrade to this minor…
Simon
  • 1,966
  • 5
  • 21
  • 35
39
votes
7 answers

angular-cli different versions in the same computer

I'm working with Angular2 in several projects. Each of this projects uses a different version of angular-cli, so, I need to be able to run and compile for production each separately with the correct version of angular-cli. When I installed…
Reiniel Herrera
  • 433
  • 1
  • 4
  • 6
39
votes
6 answers

Creating project with angular-cli takes a long time

I am using angular-cli to scaffold a new Angular2 project with ng new project_name. It takes a long time to complete, as it downloads all dependencies each time ng new is run. Is there a way to create subsequent new projects without having to…
stackinfostack
  • 650
  • 2
  • 7
  • 12
38
votes
7 answers

Angular 8 ng-build throwing MIME error with cordova

While executing ng build --prod --base-href ./ for building my cordova app, the final output throws an error as below. Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced …
Nidhin Joseph
  • 9,981
  • 4
  • 26
  • 48
38
votes
5 answers

Error in console: ng.probe is not a function

Yesterday I updated Angular CLI and core to 8.0.0v. After that I successfully initialized a new app and ran it. Once the app was built and served on localhost:4200 I opened the console and there was an error: ng.probe is not a function I tried to…
Andon Mitev
  • 1,354
  • 1
  • 11
  • 30
38
votes
2 answers

What to do "which stylesheet format would you like to use (use arrow keys) " in Angular

I'm creating an Angular project using angular cli and they are asking me "which stylesheet format would you like to use (use arrow keys)" with different formats. Why is this appearing?
Azizul Hoq
  • 589
  • 1
  • 4
  • 13
38
votes
2 answers

Angular 6: Multiple configurations (twas environments)

Trying to get angular-cli to recognise multiple configurations in angular.json C:\_dev\myapp>ng serve --configuration development Configuration 'development' could not be found in project 'myapp'. Error: Configuration 'development' could not be…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
38
votes
9 answers

Angular 2 with CLI - build for production

I have freshly installed angular-cli 1.0.0.beta.17 (latest one), start new project, able to serve project on port 4200 with no problems - just standard "app works!" message. However when I try to build for production this empty and generic…
bensiu
  • 24,660
  • 56
  • 77
  • 117
38
votes
3 answers

I want to downgrade Angular CLI globally as my project is using older version of it

I have upgraded my Angular CLI globally but my project is using an older version of angular CLI, so I want to downgrade my Angular CLI globally.
Salman Tanzil
  • 389
  • 1
  • 3
  • 4
37
votes
26 answers

ENOENT: no such file or directory, lstat '/Users/Desktop/node_modules'

An unhandled exception occurred: ENOENT: no such file or directory, lstat '/Users/Desktop/node_modules' See "/private/var/folders/3p/l_k1wk8n76v3cfwnxk0blx000000gn/T/ng- DF5EZ7/angular-errors.log" for further details. Whenever i am doing ng…
shristy sinha
  • 379
  • 1
  • 3
  • 3
37
votes
4 answers

Install Angular Unsupported Engine, OSX

I am reinstalling my MacBook. And I receive the following message when I install (npm install -g @angular/cli) angular. Any idea why? I suspect the nom version but I comes along with node... Developments npm install -g @angular/cli npm WARN…
Jean-Philippe M
  • 731
  • 1
  • 7
  • 19
37
votes
8 answers

can't find compiler ngcc module after upgrading Angular and project

I've just upgraded Angular cli and one of my project from 7.0.7 to 7.1.0. I've followed this post and @Francesco Borzi's answer. now I've tried running my project using: ng serve --proxy-config proxy.conf.json and got this message Cannot find…
JSmith
  • 4,519
  • 4
  • 29
  • 45