gpt4 book ai didi

angular - 将项目从 Angular 4 升级到 6 后无法运行项目

转载 作者:太空狗 更新时间:2023-10-29 18:14:48 25 4
gpt4 key购买 nike

我将我的 Angular 4 项目升级到了 Angular 6。

我在运行项目时遇到一个错误。

我搜索过类似的问题,但没有得到满意的答案。

 OpaqueToken is not a constructor.

这里附上我的 package.json。

{

  "dependencies": {
"@angular/animations": "6.1.9",
"@angular/common": "6.1.9",
"@angular/compiler": "6.1.9",
"@angular/compiler-cli": "6.1.9",
"@angular/core": "6.1.9",
"@angular/forms": "6.1.9",
"@angular/http": "6.1.9",
"@angular/platform-browser": "6.1.9",
"@angular/platform-browser-dynamic": "6.1.9",
"@angular/platform-server": "6.1.9",
"@angular/router": "6.1.9",
"@angular/upgrade": "6.1.9",
"@nguniversal/express-engine": "^6.1.0",
"@nguniversal/module-map-ngfactory-loader": "^6.1.0",
"angular-in-memory-web-api": "^0.3.1",
"angular-pipes": "^6.5.3",
"angular-sweetalert": "^1.1.2",
"core-js": "^2.4.1",
"ie-shim": "^0.1.0",
"lodash": "^4.17.5",
"ng2-file-upload": "^1.3.0",
"ng2-meta": "^2.0.3",
"ng2-select": "^2.0.0",
"ng2-slugify": "^0.1.0",
"ng2-vs-checklist": "0.0.1",
"ngx-bootstrap": "^3.0.1",
"ngx-owl-carousel": "^2.0.7",
"ngx-sweetalert2": "^0.2.5",
"reflect-metadata": "^0.1.9",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.3.3",
"script-loader": "^0.7.2",
"sweetalert": "^2.1.0",
"ts-loader": "^5.1.1",
"zone.js": "~0.8.26"
},


}

最佳答案

我通过更新 ng2-meta@2.0.3 解决了这个问题 使用 OpaqueToken 的包。也许哪个在 Angular 6 中不兼容。

npm install ng2-meta@5.0.0

关于angular - 将项目从 Angular 4 升级到 6 后无法运行项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52622575/

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