gpt4 book ai didi

angular - 无法解析模块@angular/core 中的错误

转载 作者:太空狗 更新时间:2023-10-29 19:33:21 26 4
gpt4 key购买 nike

在从 webpack2 迁移到 webpack4 以及从 Angular4 迁移到 Angular5 的过程中,我遇到了 webpack 编译的奇怪错误 (./node_modules/.bin/webpack- cli):

ERROR in Could not resolve module @angular/core

调试 webpack (node --inspect-brk ./node_modules/.bin/webpack-cli) 得到一个错误堆栈跟踪:

Error: Could not resolve module @angular/core
at StaticSymbolResolver.getSymbolByModule (.../node_modules/@angular/compiler/bundles/compiler.umd.js:29766:30)
at StaticReflector.findDeclaration (.../node_modules/@angular/compiler/bundles/compiler.umd.js:31635:63)
at StaticReflector.initializeConversionMap (.../node_modules/@angular/compiler/bundles/compiler.umd.js:31953:36)
at new StaticReflector (.../node_modules/@angular/compiler/bundles/compiler.umd.js:31571:14)
at Object.createAotCompiler (.../node_modules/@angular/compiler/bundles/compiler.umd.js:32957: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:327:22)
at AngularCompilerProgram._createProgramWithBasicStubs (.../node_modules/@angular/compiler-cli/src/transformers/program.js:435:73)
at .../node_modules/@angular/compiler-cli/src/transformers/program.js:143:28
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:684:11)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3

但不幸的是它仍然没有给出提示。

这里是 package.json dependancies .

报告此 issue on angular repo 。

最佳答案

我安装模块 @angular-devkit/core 解决了这个问题

关于angular - 无法解析模块@angular/core 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49647366/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com