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+
263 questions
678
votes
49 answers

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
  • 13,602
  • 7
  • 31
  • 56
71
votes
11 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
  • 880
  • 1
  • 6
  • 21
58
votes
3 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
  • 4,747
  • 2
  • 29
  • 45
51
votes
5 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 Kumar B
  • 1,163
  • 3
  • 9
  • 17
34
votes
6 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
  • 4,859
  • 15
  • 51
  • 77
32
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
  • 3,456
  • 3
  • 22
  • 46
29
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
  • 370
  • 1
  • 3
  • 10
28
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…
slideshowp2
  • 38,463
  • 29
  • 127
  • 255
28
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
  • 396
  • 1
  • 3
  • 9
27
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
  • 14,517
  • 13
  • 83
  • 111
23
votes
4 answers

How to decrease size of vendor.js in angular 2,4,6,7,8,9,10?

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
  • 7,153
  • 5
  • 52
  • 78
23
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
  • 5,785
  • 6
  • 30
  • 63
18
votes
4 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
  • 781
  • 8
  • 23
18
votes
6 answers

AngularCLI and Angular Material (schematics) error: Collection "@angular/material" cannot be resolved

I am trying to use the Angular schemats that are shown on this page. When I try to use this following command in the terminal at the root of the project ng generate @angular/material:material-nav --name name-of-new-nav, I get the following error in…
17
votes
1 answer

What is diffrence between ng update vs npm update?

Anyone please explain me about the difference between ng update in Angular 6 vs npm update?
saravana va
  • 745
  • 10
  • 15
1
2 3
17 18