简体   繁体   中英

error TS1110: Type expected in node_modules/@angular/core/core.d.ts

I Got this message errorw when running ng serve :

ERROR in node_modules/@angular/core/core.d.ts(12347,86): error TS1110: Type expected

I think its a problem of incompatibility of versions in my dependencies. I am new in Angular and i don't really know how to deal with it.

my package.json :

{
  "name": "cloudy",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@amcharts/amcharts4": "^4.7.11",
    "@amcharts/amcharts4-geodata": "^4.1.9",
    "@angular/animations": ">=6.1.10",
    "@angular/cdk": "^8.2.3",
    "@angular/common": "^6.1.10",
    "@angular/compiler": "^6.1.10",
    "@angular/core": "^8.2.3",
    "@angular/flex-layout": "^6.0.0-beta.18",
    "@angular/forms": "^6.1.10",
    "@angular/http": "^6.1.10",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "^6.1.10",
    "@angular/platform-browser-dynamic": "^6.1.10",
    "@angular/router": "^5.0.0",
    "@types/paho-mqtt": "^1.0.4",
    "@types/zen-observable": "^0.5.4",
    "angular5-social-login": "^1.0.9",
    "aws-amplify": "^1.2.4",
    "aws-sdk": "^2.580.0",
    "core-js": "^2.6.10",
    "d3": "^5.14.2",
    "expo": "^31.0.6",
    "hammerjs": "^2.0.8",
    "moment": "^2.24.0",
    "ngx-facebook": "^2.4.0",
    "ngx-tour-core": "^4.1.0",
    "ngx-tour-md-menu": "^4.1.0",
    "rxjs": "^6.5.3",
    "rxjs-compat": "^6.5.3",
    "zone.js": "^0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.10.0",
    "@angular/cli": "7.1.0",
    "@angular/compiler-cli": "^6.1.10",
    "@angular/language-service": "^6.1.10",
    "@types/jasmine": "^2.8.16",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^10.17.6",
    "codelyzer": "^4.5.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^2.0.5",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^1.4.3",
    "karma-jasmine": "^1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "node-sass": "^4.13.0",
    "protractor": "^5.4.2",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "^2.9.2",
    "webpack": "4.28.4"
  }
}

i think it's related to Typescript version try to update it to >3.4 and you can update your angular/cli too

npm uninstall angular-cli

npm cache clean

npm install --save-dev @angular/cli@latest

here is my devDependencies for example

"devDependencies": {
   "@angular/cli": "~8.1.2",
   "typescript": "~3.4.5",
   ...

}

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