问题
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"}'
回答1:
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"}'
回答2:
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.
来源:https://stackoverflow.com/questions/50425616/no-config-found-or-get-set-have-been-deprecated-in-angular-6