4
ng config --global defaults.styleExt=scss

Error: config not found

ng set --global defaults.styleExt=scss

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

Installed Packages versions

ngular CLI: 6.0.3

Node: 8.11.1

Angular: 6.0.2

@angular/cli 6.0.3

@ngtools/webpack 6.0.3

webpack 4.8.3

update

The following command gave me an error in the image

ng config schematics.@schematics/angular:component '{ styleext: "scss"}'

enter image description here

MWN
  • 377
  • 1
  • 5
  • 17
  • it should be ```ng set defaults.styleExt scss --global``` – Fateme Fazli May 19 '18 at 13:12
  • This answer may be helpful: https://stackoverflow.com/questions/50187466/turning-progress-display-off-globally-for-angular-cli-v6/50189857#50189857 – R. Richards May 19 '18 at 13:31
  • when I run the command `ng set --global default.styleExt=scss`, it gave me such warning `get/set have been deprecated in favor of the config command.` – MWN May 19 '18 at 15:48
  • May I ask for down voting reason? Did I ask irrelevant or illogical or incomplete question? – MWN May 19 '18 at 15:50
  • You are running that command with the global install of the angular cli (v6), thats why you see the warning, but your project seems to have been created with cli v1.x.x. The config file structures are different for those versions. – Jota.Toledo May 20 '18 at 12:37
  • Whether I should remove the global version and update the local cli and the run the command or what else do you recommend? – MWN May 21 '18 at 02:36

2 Answers2

3

ng set --global defaults.styleExt=scss is deprecated since ng6.

You should use:

ng config schematics.@schematics/angular:component '{ styleext: "scss"}'

If you want to target a specific project (replace {project} with your project's name):

ng config projects.{project}.schematics.@schematics/angular:component '{ styleext: "scss"}'
aloisdg
  • 22,270
  • 6
  • 85
  • 105
0

For your version you need to do this:

On terminal install this:

npm install node-sass

After this you need to rename .css files in your project to .scss and change all the calls of css to scss in your others files.

Belen Martin
  • 507
  • 5
  • 7
  • for a moment, this is good but I want to configure it once for all new angular projects to `scss` so that I should not include `--style=scss` in every project. – MWN May 29 '18 at 06:05