Questions tagged [angular-cli-v6]

Angular CLI Version 6 – Hamilton

Links

  1. Angular cli V6 Releases
  2. How to do X in Angular CLI v6?
  3. Styling Angular CLI v6 apps with Bootstrap
  4. Using Yarn with Angular CLI v6+
266 questions
883
votes
47 answers

Angular 6 - Could not find module "@angular-devkit/build-angular"

After updating to Angular 6.0.1, I get the following error on ng serve: Could not find module "@angular-devkit/build-angular" from "/home/Projects/myProjectName". Error: Could not find module "@angular-devkit/build-angular" from…
ForestG
  • 17,538
  • 14
  • 52
  • 86
89
votes
7 answers

How to Create a specific version of Angular Project using CLI?

My npm version is 5.5.1 and angular cli version is 6.2.1. When I try to create a new project using the command ng new Project_name then it is creating the latest version of Angular (in my case it is creating Angular version ^6.1.0), but I want…
Ravi
  • 1,614
  • 4
  • 14
  • 27
77
votes
12 answers

@types/googlemaps/index.d.ts' is not a module

I want to use the Google Maps API with my Angular project, so I used these two commands to install npm packages: npm install @agm/core --save-dev npm install @types/googlemaps --save-dev I added this line to my component: import {} from…
AMendis
  • 1,346
  • 4
  • 18
  • 34
72
votes
5 answers

Angular CLI 6: Where to put library dependencies

I'm converting a library (ng-app-state) to use the angular cli, now that v6 supports libraries (yay!). After scaffolding and copying in some code, here is my first question: How/where do I add 3rd party dependencies? To package.json, or to…
Eric Simonton
  • 5,702
  • 2
  • 37
  • 54
45
votes
7 answers

Angular 6+ How to change default port 4200

This question is specific to version 6 of Angular, not earlier, since .angular-cli.json file had been replaced by angular.json file. I created a new Angular 6 project and tried, as I always did with previous versions, to change its default port but…
Sami-L
  • 5,553
  • 18
  • 59
  • 87
41
votes
6 answers

How to decrease size of vendor.js in angular 2,4,6,7,8,9,10,11,12,13,14,15,16?

Angular CLI creates vendor.js and I don't know Why and What is the use of it?? Size of this file is about 3.2MB for a new app!! Does this file contains Angular 6 Javascript Source? Don't you think this is big file for loading on internet on low…
Mohamad Shiralizadeh
  • 8,329
  • 6
  • 58
  • 93
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
36
votes
2 answers

Dependency @ng-bootstrap/ng-bootstrap must be explicitly whiteliste

In angular 6 project, I created angular library using angular cli command ng g lierary @some/libName. In my library, I have a component which needs @ng-bootstrap/ng-bootstrap, so I added it by npm i --save @ng-bootstrap/ng-bootstrap. When I try to…
Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132
33
votes
2 answers

What is the difference between ng update and npm update?

Would someone please explain the difference between ng update in Angular 6 and npm update?
saravana va
  • 1,081
  • 1
  • 13
  • 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
31
votes
4 answers

Angular 6 library shared stylesheets

How can you setup a index.scss and import global stylesheets for variables, mixins, etc, to an angular 6 library? Angular CLI generates a lib with a root component & component scss, but the styles added or imported to the root component are not…
xaunlopez
  • 439
  • 1
  • 4
  • 13
30
votes
4 answers

How do I turn off source maps for Angular 6 ng test?

I am trying to turn off sourcemaps for my tests in Angular 6. I know the sourcemaps switch has been removed, e.g., ng test --sourcemaps=false. I have tried modifying my tsconfig file: { "extends": "../tsconfig.json", "compilerOptions": { ... …
ja6a
  • 416
  • 1
  • 6
  • 10
26
votes
5 answers

Is it possible to generate multiple Angular components using single angular-cli command like ng generate component comp1, comp2, comp3?

I need to create ten Angular components like comp1, comp2, comp3, comp4, ..., comp10. So I need to execute same command for ten times for each component like ng g c comp1, ng g c comp2, etc. Is there any option to generate multiple angular…
ranjit redekar
  • 919
  • 1
  • 12
  • 24
25
votes
1 answer

ENOENT: no such file or directory for node_modules\jquery\dist\jquery.min.js'

I am not sure what I am doing wrong: I am following the tutorial here, but I keep getting the following error: ENOENT: no such file or directory, open 'C:\Users\andrewkp\Documents\VSCode\Projects\node_modules\jquery\dist\jquery.min.js' Error:…
monstertjie_za
  • 7,277
  • 8
  • 42
  • 73
22
votes
6 answers

How do you debug an Angular 6 library

I'm writing an Angular 6 Library and cannot figure out how to step into the typescript. I generated the app using: ng new mylibapp I then added the library using: ng g library @abc/cool-lib -p abc when I perform: ng build @abc/cool-lib it generates…
JoAMoS
  • 1,459
  • 3
  • 18
  • 27
1
2 3
17 18