简体   繁体   中英

My Angular 6 project failing to build. node_modules/@angular/core/core.d.ts(12620,86): error TS1110: Type expected

Whenever i try to build the project i get the screenshot error message below. Have included my package.json file with the dependencies i use.

Been a few days struggling with the same problem and the solutions i have found are not working.

"dependencies": {
    "@angular/animations": "^6.0.5",
    "@angular/cdk": "^6.4.1",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^9.1.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.4.1",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "@syncfusion/ej2": "^17.4.51",
    "@syncfusion/ej2-angular-schedule": "^17.4.51",
    "angular": "^1.8.2",
    "angular-material": "^1.1.9",
    "angular-password-strength-meter": "^2.0.0",
    "angular-webstorage-service": "^1.0.2",
    "chart.js": "^2.7.2",
    "clie": "^0.2.0",
    "core-js": "^2.6.12",
    "countup.js-angular2": "^6.0.1",
    "hammerjs": "^2.0.8",
    "jquery": "^3.4.1",
    "ng-animate": "^0.3.3",
    "ng2-charts": "^1.6.0",
    "ngx-loading": "^3.0.1",
    "rc-calendar": "^9.7.10",
    "react-native-calendars": "^1.21.0",
    "rxjs": "6.3.3",
    "zone.js": "^0.8.26",
    "zxcvbn": "^4.4.2"
  },
"devDependencies": {
    "@angular-devkit/build-angular": "^0.6.8",
    "@angular/cli": "^6.0.8",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "node-sass": "^4.14.1",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "^2.8.0"
  }

Image of the error message i get when i run the project

使用以下命令卸载当前版本的 Typescript: npm uninstall typescript --save 然后重新安装 i: npm install typescript --save-dev

Uninstall the version of TS that you're running on. Install the latest version of TS available to you at that point

npm uninstall -D typescript 
npm i -D typescript@4.2.4

To get an idea you can refer this also: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/8769

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM