Error TS1005 expected TypeScript for First Build error rxjs inside node modules

0 votes

This is my 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 the following 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. Note that after I got this error I deleted node_modules and I installed using npm install wished I got away still I got this error.

Here is my package.JSON file:

{
 "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"
                 }
               }
Jun 9, 2022 in TypeSript by Logan
• 2,140 points
2,816 views

1 answer to this question.

0 votes

 I investigated that rxjs released a new version: 6.4.0. And it broke the build. According to review, the minimum supported version of TypeScript is 2.8. If you don't want to update TypeScript version, just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json.

answered Jun 10, 2022 by Nina
• 3,060 points

Related Questions In TypeSript

0 votes
1 answer

TypeScript error TS2304: cannot find name ' require'

Here's a really easy work around: declare var ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
13,895 views
0 votes
1 answer

What is "not assignable to parameter of type never" error in TypeScript?

All you have to do is define ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
57,210 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to apply zoom animation for each element of a list in angular?

Hey @Sid, do check if this link ...READ MORE

answered Jul 30, 2019 in Others by Vardhan
• 13,150 points
1,550 views
0 votes
1 answer

Can't bind to 'formGroup' since it isn't a known property of 'form'

In order to rectify this error, you ...READ MORE

answered Feb 10, 2022 in Others by Rahul
• 9,680 points
21,285 views
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,600 points
2,201 views
0 votes
1 answer

TypeScript Object assign gives me an error property assign does not exist on type ObjectConstructor

For TypeScript 2.1 and higher, you can ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
2,067 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP