1

尝试使用 prod 标志构建时出现以下 angular cli 错误。

以前我使用 angular-cli 1.6.3然后它工作得很好,但现在我在不同的 PC 上新安装了 angular-cli 1.7.0并在执行 ng build --prod 时出现以下错误

在 ./src/$$_gendir/node_modules/ngx-chips/ngx-chips.ngfactory.ts “找不到模块:错误:无法解析 'D:\Project\angular 中的 'ngx-chips/components/index' -test\src\$$_gendir\node_modules\ngx-chips

我需要将我的 angular-cli 版本降级到 1.6.3 还是将我的项目 cli 版本升级到 1.7.0?这是我的 package.json 文件

{
  "name": "my-sample-project",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.1.3",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@types/underscore": "^1.8.3",
    "angular2-jwt": "^0.2.3",
    "async": "^2.4.1",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "jquery": "^3.2.1",
    "ngx-chips": "^1.5.11",
    "ngx-pagination": "^3.0.1",
    "papaparse": "^4.3.2",
    "rxjs": "^5.1.0",
    "sweetalert2": "^6.10.1",
    "underscore": "^1.8.3",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.3",
    "@angular/compiler-cli": "^4.0.0",
    "@types/async": "^2.0.40",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "@types/papaparse": "^4.1.28",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.2.0"
  }
}
4

0 回答 0