我正在尝试按照此guide构建一个Angular 4 Universal App。但是,当我调用ngc
生成NgModuleNgFactory
时失败了,我收到了这个错误:
Error: Compilation failed. Resource file not found: /home/poi/Projects/solomon/src/app/module/archive/~@angular/material/theming
at ModuleResolutionHostAdapter.readResource (/home/poi/Projects/solomon/node_modules/@angular/compiler-cli/src/compiler_host.js:370:19)
at CompilerHost.loadResource (/home/poi/Projects/solomon/node_modules/@angular/compiler-cli/src/compiler_host.js:243:85)
at Object.get (/home/poi/Projects/solomon/node_modules/@angular/compiler/bundles/compiler.umd.js:24640:107)
at DirectiveNormalizer._fetch (/home/poi/Projects/solomon/node_modules/@angular/compiler/bundles/compiler.umd.js:13297:45)
at /home/poi/Projects/solomon/node_modules/@angular/compiler/bundles/compiler.umd.js:13426:53
at Array.map (native)
at DirectiveNormalizer._loadMissingExternalStylesheets (/home/poi/Projects/solomon/node_modules/@angular/compiler/bundles/compiler.umd.js:13426:14)
at /home/poi/Projects/solomon/node_modules/@angular/compiler/bundles/compiler.umd.js:13429:26
at process._tickCallback (internal/process/next_tick.js:109:7)
at Module.runMain (module.js:607:11)
Compilation failed
看起来编译器正在尝试处理不存在的文件/home/poi/Projects/solomon/src/app/module/archive/~@angular/material/theming
,我在guide之后的scss中导入了~@angular/material/theming
。
那么如何谈论文件编译器的位置? :(
仅供参考,@angular/material
的版本为2.0.0-beta.5
,而@angular/compiler
和@angular/compiler-cli
均为4.1.2
。