我正在构建一个Angular 5+库。该项目基于angular-quickstart-lib的结构。当我运行构建脚本时,我收到一条错误,指出@ angular / core无法解析。
Error: Error: Could not resolve module @angular/core
at StaticSymbolResolver.getSymbolByModule (...\node_modules\@angular\compiler\bundles\compiler.umd.js:31884:30)
at StaticReflector.findDeclaration (...\node_modules\@angular\compiler\bundles\compiler.umd.js:30371:63)
at StaticReflector.initializeConversionMap (...\node_modules\@angular\compiler\bundles\compiler.umd.js:30636:36)
at new StaticReflector (...\node_modules\@angular\compiler\bundles\compiler.umd.js:30317:14)
at Object.createAotCompiler (...\node_modules\@angular\compiler\bundles\compiler.umd.js:32125:44)
at AngularCompilerProgram._createCompiler (...\node_modules\@angular\compiler-cli\src\transformers\program.js:404:37)
at AngularCompilerProgram.get [as hostAdapter] (...\node_modules\@angular\compiler-cli\src\transformers\program.js:323:22)
at AngularCompilerProgram._createProgramWithBasicStubs (...\node_modules\@angular\compiler-cli\src\transformers\program.js:435:73)
at AngularCompilerProgram.initSync (...\node_modules\@angular\compiler-cli\src\transformers\program.js:377:27)
at AngularCompilerProgram.get [as tsProgram] (...\node_modules\@angular\compiler-cli\src\transformers\program.js:353:22)
进一步深入“node_modules \ @angular \ compiler \ bundles \ compiler.umd.js”,错误似乎来自“this.host.moduleNameToFileName”。