No config found or get/set have been deprecated in angular 6

不想你离开。 提交于 2019-12-19 23:21:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!