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
37
votes
4 answers

TypeError: Cannot read property 'members' of undefined

I started upgrading from Angular 4.4.4 to 5.1.1 today. I have had to upgrade a number of other packages that rely on angular as well. I get an error with so little context that I have no idea where to start. Has anyone else seen this and know what…
bygrace
  • 5,868
  • 1
  • 31
  • 58
37
votes
4 answers

Set base href from an environment variable with ng build

Does anyone know how to accomplish this with the angular-cli? I would like to be able to store the baseHref path in an environment variable within /src/environments/environment.x.ts and based on the selected evironment during build, be able to set…
ryanulit
  • 4,983
  • 6
  • 42
  • 66
37
votes
4 answers

Using Angular-CLI build to copy a file / directory

Is there a way to make angular-cli's ng buil --prod command to also copy a file/directory to the dist folder? My project includes a "server" folder, and a "config.js" file at root, and I need them to be copied to "dist" such that when building, I…
Amit
  • 5,924
  • 7
  • 46
  • 94
37
votes
1 answer

Whats the default path for static files in Angular2?

I'm currently working on a small Angular2 project. In my case i have to reroute some of the requests (like "/faq", "/aboutus") back to my old backend server to get some server side rendered thymeleaf templates. Therefore i'm using the built in proxy…
Lucca
  • 1,447
  • 4
  • 16
  • 20
36
votes
15 answers

TypeError: Cannot read property 'kind' of undefined at getAssignmentTargetKind

This problem started to occur when updating my Angular 6 project to 7.x. I opened an issue on the angular-cli github repo but they couldn't help. So what I did is create a new project and add all components one by one to "hopefully" notice what…
rawk
  • 508
  • 1
  • 7
  • 13
36
votes
18 answers

Npm ERR! code EPERM

I'm using node v6.11.2, npm v5.3.0 and angular/cli v1.2.7. I'm suddenly receiving the following error message for a majority of my npm installs. Never seen it before... mmeppiel@MC-LT-MMEPPIEL MINGW64 ~/Desktop/Angular Solutions/my-app (master) $…
Matthew Meppiel
  • 966
  • 3
  • 14
  • 29
36
votes
9 answers

how to deploy angular2 app built using angular-cli

I have created n new angular app using angular-cli. I completed the app and preview it using ng-serve, it is working perfectly. After that I used ng build --prod, that generates the 'dist' folder. When I put that folder in xampp to run, it is not…
raju
  • 6,448
  • 24
  • 80
  • 163
36
votes
3 answers

Can I pass arguments to angular-cli at build-time

I would like to pass custom arguments to angular-cli when building an Angular2 (typescript) app. Is this possible? How can I access this arguments in my code? The scenario is like this: I have one Angular2 app with 2 layouts. Each layout has 3…
Arthur Helmel
  • 421
  • 1
  • 4
  • 5
35
votes
13 answers

Angular 12 Data path "" must NOT have additional properties (styleext)

What is wrong with the new version of Angular? Angular CLI 12.0.1 can't create new application. Tried to run ng new twelveApp and the cli complains dying Data path "" must NOT have additional properties (styleext). I have tried to set the ng-new…
Bellash
  • 7,560
  • 6
  • 53
  • 86
35
votes
6 answers

Error: Please, upgrade your dependencies to the actual version of core-js@3

I'm trying to run npm start but giving me error "An unhandled exception occurred: Could not find module "@angular-devkit/build-angular" I also tried to install it by using npm install @angular-devkit/build-angular but still getting me an…
Never Stop Learning
  • 755
  • 1
  • 10
  • 34
35
votes
4 answers

Angular Injectable decorator - Expected 0 arguments but got 1

I am just getting started with the base tutorial for Angular but I face a small compilation issue. I am following the tutorial on Angular's website. I am stuck with the dependency injection part because it doesn't want to compile. In the tutorial…
Atom
  • 353
  • 1
  • 3
  • 6
34
votes
2 answers

Using scss as default style sheet in Angular 6+ (styleExt)

Apparently the way to declare the default stylesheet extension changed from Angular 6 onwards. The styleExt property in the angular.json is not recognised any longer. For new projects this can be set with an option on the CLI --style=scss on the new…
Daniel Lerps
  • 5,256
  • 3
  • 23
  • 33
34
votes
2 answers

How to handle routing in Angular 5+ Service Workers?

In previous versions of the Angular service worker implementation, one of the config options was "routing". This can be seen in this unanswered SO question, was referenced in this Angular CLI issue, and the best remaining documentation seems to be…
34
votes
5 answers

WARNING in Circular dependency detected - Angular Cli

https://github.com/angular/angular-cli/pull/6813 Added warnings for circular dependencies, and I know I can turn off all warnings using "showCircularDependencies": false. But I would rather keep the circular dependency warnings on. Is there a…
34
votes
3 answers

Is it possible to build separate CSS file with angular-cli?

By default everything is bundled in: inline.bundle.js polyfills.bundle.js styles.bundle.js vendor.bundle.js main.bundle.js Is it possible to have separate CSS file?
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176