gpt4 book ai didi

angular - 找不到模块 '@angular/core/src/render3'

转载 作者:行者123 更新时间:2023-12-04 17:31:07 25 4
gpt4 key购买 nike

从 angular 7 更新到 8 后,我遇到了一些麻烦。

 ng --version

Angular CLI: 8.3.22
Node: 10.18.1
OS: linux x64
Angular: 8.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.803.22
@angular-devkit/build-angular 0.803.22
@angular-devkit/build-optimizer 0.803.22
@angular-devkit/build-webpack 0.803.22
@angular-devkit/core 8.3.22
@angular-devkit/schematics 8.3.22
@angular/cdk 8.0.2
@angular/cli 8.3.22
@angular/flex-layout 8.0.0-beta.27
@angular/material 8.0.2
@ngtools/webpack 8.3.22
@schematics/angular 8.3.22
@schematics/update 0.803.22
rxjs 6.4.0
typescript 3.4.5
webpack 4.39.2

所以这是我的 package.json:
  "dependencies": {
"@angular/animations": "^8.0.0",
"@angular/cdk": "~8.0.0",
"@angular/common": "^8.0.0",
"@angular/compiler": "^8.0.0",
"@angular/core": "^8.0.0",
"@angular/flex-layout": "~8.0.0-beta.27",
"@angular/forms": "^8.0.0",
"@angular/material": "~8.0.0",
"@angular/platform-browser": "^8.0.0",
"@angular/platform-browser-dynamic": "^8.0.0",
"@angular/router": "^8.0.0",
"browserslist": "^4.8.3",
"caniuse-lite": "^1.0.30001020",
"chromedriver": "^79.0.0",
"classlist.js": "^1.1.20150312",
"core-js": "~2.6.11",
...
"material-design-icons": "~3.0.1",
"rxjs": "~6.4.0",
"tslib": "~1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.803.22",
...
},

它没有什么特别之处。
当我尝试构建我的项目时,我得到 Cannot find module '@angular/core/src/render3'是的:
ls node_modules/@angular/core/src/
core.externs.js r3_symbols.d.ts testability

什么是渲染3?我敢打赌,依赖项的某些版本不匹配,但这次我无法弄清楚。

最佳答案

利用

import { ******* } from "@angular/core";
代替
import { ******* } from "@angular/core/src/render3";

关于angular - 找不到模块 '@angular/core/src/render3',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59731977/

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