1.執行ng g component 組件名,報錯:
Error: More than one module matches. Use skip-import option to skip importing the component into the closest module.
More than one module matches. Use skip-import option to skip importing the component into the closest module.
解決思路:按照提示執行ng g component 組件名 --skip-import,報錯信息變了,如下:
Error: dryRunSink.commit(...).ignoreElements is not a function
dryRunSink.commit(...).ignoreElements is not a function
最終解決辦法為:
先執行:npm i @angular-devkit/schematics@0.0.45 @angular/cli --no-sav
再執行:ng g component 組件名 --skip-import
問題解決!!