error TS1005: ';' expected. Typescript Angular 6 For First Build error rxjs inside node_modules

  • A+
Category:Languages

Hello I'm building first Angular Application . I'm creating a new angular application using this command ng new purchase-section. But when I executing the application using ng serve -o I got this error .

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected. node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected. node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

I have inspected types.d.ts as I know it is created by angular . I'm not able to understand the error . Please note that after I got this error I deleted node_modules and I install using npm install wished i got away still I got this error . Your help will be highly appreciated. Here is My package.JSON code

{  "name": "purchase-section",  "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": "^6.0.3",      "@angular/common": "^6.0.3",      "@angular/compiler": "^6.0.3",      "@angular/core": "^6.0.3",      "@angular/forms": "^6.0.3",       "@angular/http": "^6.0.3",       "@angular/platform-browser": "^6.0.3",       "@angular/platform-browser-dynamic": "^6.0.3",       "@angular/router": "^6.0.3",        "core-js": "^2.5.4",        "rxjs": "^6.0.0",         "zone.js": "^0.8.26"        },       "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": "^4.0.0",                  "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",                  "protractor": "^5.4.2",                   "ts-node": "~5.0.1",                   "tslint": "~5.9.1",                 "typescript": "~2.7.2"                  }                } 

 


Just remove ^ from "rxjs": "^6.0.0" from package.json and make it "rxjs": "6.0.0" and it should work fine.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: