首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从角度8更新到9的位置0处的值。

从角度8更新到9的位置0处的值。
EN

Stack Overflow用户
提问于 2020-02-13 10:33:15
回答 2查看 16.6K关注 0票数 19

当我按照update.angular.io上的更新指南(+运行npm更新)并试图使用ng serve编译网站时,我正在将项目从角8更新到9,得到以下错误:

代码语言:javascript
复制
ERROR in Failed to compile entry-point angular-font-awesome (es2015 as esm2015) due to compilation errors:
node_modules/angular-font-awesome/dist/angular-font-awesome.js:3968:26 - error NG1010: Value at position 0 in the NgModule.imports of AngularFontAwesomeModule is not a reference: [object Object]

3968                 imports: [CommonModule],

任何帮助都是非常感谢的。

更新

我的ng version输出:

代码语言:javascript
复制
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 9.0.2
Node: 12.13.1
OS: win32 x64

Angular: 9.0.1
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.2
@angular-devkit/build-angular     0.900.2
@angular-devkit/build-optimizer   0.900.2
@angular-devkit/build-webpack     0.900.2
@angular-devkit/core              9.0.2
@angular-devkit/schematics        9.0.2
@angular/cdk                      9.0.0
@angular/cli                      9.0.2
@angular/material                 9.0.0
@ngtools/webpack                  9.0.2
@schematics/angular               9.0.2
@schematics/update                0.900.2
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

我的package.json:

代码语言:javascript
复制
{
  "name": "avior",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~9.0.1",
    "@angular/cdk": "~9.0.0",
    "@angular/common": "~9.0.1",
    "@angular/compiler": "^9.0.1",
    "@angular/core": "~9.0.1",
    "@angular/forms": "~9.0.1",
    "@angular/material": "^9.0.0",
    "@angular/platform-browser": "~9.0.1",
    "@angular/platform-browser-dynamic": "^9.0.1",
    "@angular/router": "~9.0.1",
    "@fortawesome/fontawesome": "^1.1.8",
    "@ngtools/webpack": "^9.0.2",
    "angular-font-awesome": "^3.1.2",
    "angular-tree-component": "^8.5.4",
    "bootstrap": "^4.4.1",
    "chromedriver": "^79.0.3",
    "core-js": "^2.6.11",
    "font-awesome": "^4.7.0",
    "fontawesome": "^5.6.3",
    "gitignore": "^0.6.0",
    "jquery": "^3.4.1",
    "moment": "^2.24.0",
    "popper.js": "^1.16.1",
    "rxjs": "^6.5.4",
    "tslib": "^1.10.0",
    "webdriver-manager": "^12.1.7",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.900.2",
    "@angular/cli": "^9.0.2",
    "@angular/compiler-cli": "^9.0.1",
    "@angular/language-service": "~9.0.1",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^12.11.1",
    "angular-ide": "^0.9.73",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "^5.4.3",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "^3.7.5"
  }
}

我的tsconfig.ts:

代码语言:javascript
复制
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "downlevelIteration": true,
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

更新2卸载angular-font-awesome软件包后,我只收到一个与棱角插件有关的错误:

代码语言:javascript
复制
ERROR in Failed to compile entry-point angular-tree-component (module as esm5) due to compilation errors:
node_modules/mobx-angular/dist/mobx-angular.d.ts:8:22 - error NG6002: Appears in the NgModule.imports of TreeModule, but could not be resolved to an NgModule class

8 export declare class MobxAngularModule {
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-02-22 18:41:13

如果要在角9+中使用字体强大的字体,可以使用以下命令:

代码语言:javascript
复制
 ng add @fortawesome/angular-fontawesome

贷给FortAwesome

票数 22
EN

Stack Overflow用户

发布于 2020-02-13 12:50:42

因此,使用npm uninstall angular-font-awesome删除角字体,使用ng add @fortawesome/angular-fontawesome@0.6.0添加新包,然后通过添加

代码语言:javascript
复制
"angularCompilerOptions": {
    "enableIvy": false
  }

tsconfig.app.json和ts.spec.json似乎已经解决了这些问题。

票数 14
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60205726

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档