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












22















I'm building 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"
}
}









share|improve this question









New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

    – martin
    6 hours ago











  • Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

    – yfdgvf asdasdas
    42 mins ago
















22















I'm building 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"
}
}









share|improve this question









New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

    – martin
    6 hours ago











  • Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

    – yfdgvf asdasdas
    42 mins ago














22












22








22


2






I'm building 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"
}
}









share|improve this question









New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm building 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"
}
}






angular typescript






share|improve this question









New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









double-beep

2,1382824




2,1382824






New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Rifat MurtuzaRifat Murtuza

11115




11115




New contributor




Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Rifat Murtuza is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

    – martin
    6 hours ago











  • Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

    – yfdgvf asdasdas
    42 mins ago



















  • Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

    – martin
    6 hours ago











  • Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

    – yfdgvf asdasdas
    42 mins ago

















Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

– martin
6 hours ago





Related issue on RxJS GitHub page: github.com/ReactiveX/rxjs/issues/4512

– martin
6 hours ago













Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

– yfdgvf asdasdas
42 mins ago





Hey did you ever find a answer to this problem, I am having the same issue and none of the below answers solved anything. By the way I am using ng4(Angular 4).

– yfdgvf asdasdas
42 mins ago












11 Answers
11






active

oldest

votes


















21














I had the same issue. 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.






share|improve this answer










New contributor




Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

    – kalai
    yesterday











  • just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

    – Nasreen Ustad
    19 hours ago



















12














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






share|improve this answer










New contributor




Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

    – Jeremy Thille
    yesterday













  • That did it, life saver.

    – RyanOC
    8 hours ago



















5














I was facing the same issue while developing an angular6 project. I spent more time finally it's working for me.



Here is the solution:




  1. Open "package.json"2



  2. rxjs and "TypeScript" verstion like below screenshot



    enter image description here




  3. Change like the below screenshot:



    enter image description here



  4. Next go to your project folder and delete "node_modules" folder.


  5. After deleting, next run npm install in your project folder


  6. Finally run ng serve. It should work (I tried 3 projects and confirmed).







share|improve this answer


























  • This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

    – Viocartman
    yesterday



















1














Seems like your Angular and/or rxjs version is not compatible with TypeScript.



Remove the ~ sign in the TypeScript version, add ^ instead. Then, install packages again.



Try running npm start and ng build prior to ng serve.






share|improve this answer


























  • did this but same error

    – Rifat Murtuza
    yesterday











  • Restart Visual Studio after this. What is your TS version now?

    – Code_maniac
    yesterday











  • this helped me. Thanks! (new version 2.9.2 worked perfectly)

    – bakytn
    12 hours ago



















1














Just change the TypeScript dependency version to ^2.8






share|improve this answer


























  • This is just a duplicate of this IMO.

    – double-beep
    16 hours ago



















1














In your Package.json file remove ^ symbol (caret) from "rxjs": "^6.0.0" and add "rxjs": "6.0.0" it will work fine.






share|improve this answer


























  • This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

    – double-beep
    16 hours ago



















0














I have tried all the other answers. But I found issue. I had ts lint plugin installed which forced file to be ended without space. I removed it and it is working.



You can also remove the space going to that specific file.






share|improve this answer

































    0














    These two changes what you want:



    // in package.json:


    "rxjs": "^6.2.2" ==> "rxjs": "latest"
    "typescript": "2.7.2" ==> "typescript": "2.8"



    where ==> means to replace






    share|improve this answer

































      0














      You can update your npm version to the latest, if it isn't, with:



      npm update -g





      share|improve this answer


























      • this will update rxjs and the typescrip

        – Hezy Ziv
        yesterday



















      0














      I changed the version for rxjs and typescript. My package.json has the following entries
      "typescript": "^2.7.2"
      "rxjs": "^6.3.3",



      I also had to upgrade angular cli.






      share|improve this answer








      New contributor




      sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




























        0














        Your package.json has following lines:



        "rxjs": "^6.0.0",

        "typescript": "~2.7.2"


        This tells npm to install the following versions



        rxjs: Latest version in version 6 series which is 6.4.0



        typescript: Latest patched version in minor version 2.7 which is 2.7.2



        Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.



        So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as



        typescript: ^2.8.0



        or bump down the version of ngrx to something like



        ngrx: ~6.0.0 and



        do a fresh npm install.



        You can check the version number of the module installed by looking in following files:



        node_modules/rxjs/package.json and
        node_modules/typescript/package.json





        share|improve this answer























          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Rifat Murtuza is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54434333%2ferror-ts1005-expected-typescript-angular-6-for-first-build-error-rxjs-insi%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          11 Answers
          11






          active

          oldest

          votes








          11 Answers
          11






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          21














          I had the same issue. 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.






          share|improve this answer










          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

            – kalai
            yesterday











          • just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

            – Nasreen Ustad
            19 hours ago
















          21














          I had the same issue. 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.






          share|improve this answer










          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





















          • i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

            – kalai
            yesterday











          • just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

            – Nasreen Ustad
            19 hours ago














          21












          21








          21







          I had the same issue. 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.






          share|improve this answer










          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










          I had the same issue. 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.







          share|improve this answer










          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited yesterday









          double-beep

          2,1382824




          2,1382824






          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered yesterday









          Bolat KazybayevBolat Kazybayev

          21114




          21114




          New contributor




          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Bolat Kazybayev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.













          • i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

            – kalai
            yesterday











          • just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

            – Nasreen Ustad
            19 hours ago



















          • i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

            – kalai
            yesterday











          • just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

            – Nasreen Ustad
            19 hours ago

















          i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

          – kalai
          yesterday





          i have same issue my "typescript": "~3.2.2" and "rxjs": "6.3.3" please tell me anyone how to solve this error?

          – kalai
          yesterday













          just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

          – Nasreen Ustad
          19 hours ago





          just change "rxjs": "^6.0.0", to "rxjs": "6.3.3" in package.json and run command npm install again so it will update it in your project. Now It will work

          – Nasreen Ustad
          19 hours ago













          12














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






          share|improve this answer










          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.
















          • 1





            I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

            – Jeremy Thille
            yesterday













          • That did it, life saver.

            – RyanOC
            8 hours ago
















          12














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






          share|improve this answer










          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.
















          • 1





            I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

            – Jeremy Thille
            yesterday













          • That did it, life saver.

            – RyanOC
            8 hours ago














          12












          12








          12







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






          share|improve this answer










          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.










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







          share|improve this answer










          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer








          edited yesterday









          double-beep

          2,1382824




          2,1382824






          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered yesterday









          AdityaAditya

          1293




          1293




          New contributor




          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          Aditya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.








          • 1





            I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

            – Jeremy Thille
            yesterday













          • That did it, life saver.

            – RyanOC
            8 hours ago














          • 1





            I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

            – Jeremy Thille
            yesterday













          • That did it, life saver.

            – RyanOC
            8 hours ago








          1




          1





          I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

          – Jeremy Thille
          yesterday







          I then had to delete my node_modules and run npm i again, but it worked. (Alternative : npm update)

          – Jeremy Thille
          yesterday















          That did it, life saver.

          – RyanOC
          8 hours ago





          That did it, life saver.

          – RyanOC
          8 hours ago











          5














          I was facing the same issue while developing an angular6 project. I spent more time finally it's working for me.



          Here is the solution:




          1. Open "package.json"2



          2. rxjs and "TypeScript" verstion like below screenshot



            enter image description here




          3. Change like the below screenshot:



            enter image description here



          4. Next go to your project folder and delete "node_modules" folder.


          5. After deleting, next run npm install in your project folder


          6. Finally run ng serve. It should work (I tried 3 projects and confirmed).







          share|improve this answer


























          • This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

            – Viocartman
            yesterday
















          5














          I was facing the same issue while developing an angular6 project. I spent more time finally it's working for me.



          Here is the solution:




          1. Open "package.json"2



          2. rxjs and "TypeScript" verstion like below screenshot



            enter image description here




          3. Change like the below screenshot:



            enter image description here



          4. Next go to your project folder and delete "node_modules" folder.


          5. After deleting, next run npm install in your project folder


          6. Finally run ng serve. It should work (I tried 3 projects and confirmed).







          share|improve this answer


























          • This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

            – Viocartman
            yesterday














          5












          5








          5







          I was facing the same issue while developing an angular6 project. I spent more time finally it's working for me.



          Here is the solution:




          1. Open "package.json"2



          2. rxjs and "TypeScript" verstion like below screenshot



            enter image description here




          3. Change like the below screenshot:



            enter image description here



          4. Next go to your project folder and delete "node_modules" folder.


          5. After deleting, next run npm install in your project folder


          6. Finally run ng serve. It should work (I tried 3 projects and confirmed).







          share|improve this answer















          I was facing the same issue while developing an angular6 project. I spent more time finally it's working for me.



          Here is the solution:




          1. Open "package.json"2



          2. rxjs and "TypeScript" verstion like below screenshot



            enter image description here




          3. Change like the below screenshot:



            enter image description here



          4. Next go to your project folder and delete "node_modules" folder.


          5. After deleting, next run npm install in your project folder


          6. Finally run ng serve. It should work (I tried 3 projects and confirmed).








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday









          double-beep

          2,1382824




          2,1382824










          answered yesterday









          imjayabalimjayabal

          829




          829













          • This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

            – Viocartman
            yesterday



















          • This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

            – Viocartman
            yesterday

















          This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

          – Viocartman
          yesterday





          This seems to work for me but do you know what the actual reason for this error is ? I mean until now it worked fine with the "^" symbol. Do you maybe have more details regarding what is causing this error ? Thanks

          – Viocartman
          yesterday











          1














          Seems like your Angular and/or rxjs version is not compatible with TypeScript.



          Remove the ~ sign in the TypeScript version, add ^ instead. Then, install packages again.



          Try running npm start and ng build prior to ng serve.






          share|improve this answer


























          • did this but same error

            – Rifat Murtuza
            yesterday











          • Restart Visual Studio after this. What is your TS version now?

            – Code_maniac
            yesterday











          • this helped me. Thanks! (new version 2.9.2 worked perfectly)

            – bakytn
            12 hours ago
















          1














          Seems like your Angular and/or rxjs version is not compatible with TypeScript.



          Remove the ~ sign in the TypeScript version, add ^ instead. Then, install packages again.



          Try running npm start and ng build prior to ng serve.






          share|improve this answer


























          • did this but same error

            – Rifat Murtuza
            yesterday











          • Restart Visual Studio after this. What is your TS version now?

            – Code_maniac
            yesterday











          • this helped me. Thanks! (new version 2.9.2 worked perfectly)

            – bakytn
            12 hours ago














          1












          1








          1







          Seems like your Angular and/or rxjs version is not compatible with TypeScript.



          Remove the ~ sign in the TypeScript version, add ^ instead. Then, install packages again.



          Try running npm start and ng build prior to ng serve.






          share|improve this answer















          Seems like your Angular and/or rxjs version is not compatible with TypeScript.



          Remove the ~ sign in the TypeScript version, add ^ instead. Then, install packages again.



          Try running npm start and ng build prior to ng serve.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday









          double-beep

          2,1382824




          2,1382824










          answered yesterday









          Code_maniacCode_maniac

          1651211




          1651211













          • did this but same error

            – Rifat Murtuza
            yesterday











          • Restart Visual Studio after this. What is your TS version now?

            – Code_maniac
            yesterday











          • this helped me. Thanks! (new version 2.9.2 worked perfectly)

            – bakytn
            12 hours ago



















          • did this but same error

            – Rifat Murtuza
            yesterday











          • Restart Visual Studio after this. What is your TS version now?

            – Code_maniac
            yesterday











          • this helped me. Thanks! (new version 2.9.2 worked perfectly)

            – bakytn
            12 hours ago

















          did this but same error

          – Rifat Murtuza
          yesterday





          did this but same error

          – Rifat Murtuza
          yesterday













          Restart Visual Studio after this. What is your TS version now?

          – Code_maniac
          yesterday





          Restart Visual Studio after this. What is your TS version now?

          – Code_maniac
          yesterday













          this helped me. Thanks! (new version 2.9.2 worked perfectly)

          – bakytn
          12 hours ago





          this helped me. Thanks! (new version 2.9.2 worked perfectly)

          – bakytn
          12 hours ago











          1














          Just change the TypeScript dependency version to ^2.8






          share|improve this answer


























          • This is just a duplicate of this IMO.

            – double-beep
            16 hours ago
















          1














          Just change the TypeScript dependency version to ^2.8






          share|improve this answer


























          • This is just a duplicate of this IMO.

            – double-beep
            16 hours ago














          1












          1








          1







          Just change the TypeScript dependency version to ^2.8






          share|improve this answer















          Just change the TypeScript dependency version to ^2.8







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 16 hours ago









          double-beep

          2,1382824




          2,1382824










          answered yesterday









          Sanju VargheseSanju Varghese

          30913




          30913













          • This is just a duplicate of this IMO.

            – double-beep
            16 hours ago



















          • This is just a duplicate of this IMO.

            – double-beep
            16 hours ago

















          This is just a duplicate of this IMO.

          – double-beep
          16 hours ago





          This is just a duplicate of this IMO.

          – double-beep
          16 hours ago











          1














          In your Package.json file remove ^ symbol (caret) from "rxjs": "^6.0.0" and add "rxjs": "6.0.0" it will work fine.






          share|improve this answer


























          • This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

            – double-beep
            16 hours ago
















          1














          In your Package.json file remove ^ symbol (caret) from "rxjs": "^6.0.0" and add "rxjs": "6.0.0" it will work fine.






          share|improve this answer


























          • This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

            – double-beep
            16 hours ago














          1












          1








          1







          In your Package.json file remove ^ symbol (caret) from "rxjs": "^6.0.0" and add "rxjs": "6.0.0" it will work fine.






          share|improve this answer















          In your Package.json file remove ^ symbol (caret) from "rxjs": "^6.0.0" and add "rxjs": "6.0.0" it will work fine.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 16 hours ago









          double-beep

          2,1382824




          2,1382824










          answered 17 hours ago









          Sagar JadhavSagar Jadhav

          52927




          52927













          • This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

            – double-beep
            16 hours ago



















          • This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

            – double-beep
            16 hours ago

















          This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

          – double-beep
          16 hours ago





          This is just a duplicate answer of this one IMO. Before posting here, check the other answers.

          – double-beep
          16 hours ago











          0














          I have tried all the other answers. But I found issue. I had ts lint plugin installed which forced file to be ended without space. I removed it and it is working.



          You can also remove the space going to that specific file.






          share|improve this answer






























            0














            I have tried all the other answers. But I found issue. I had ts lint plugin installed which forced file to be ended without space. I removed it and it is working.



            You can also remove the space going to that specific file.






            share|improve this answer




























              0












              0








              0







              I have tried all the other answers. But I found issue. I had ts lint plugin installed which forced file to be ended without space. I removed it and it is working.



              You can also remove the space going to that specific file.






              share|improve this answer















              I have tried all the other answers. But I found issue. I had ts lint plugin installed which forced file to be ended without space. I removed it and it is working.



              You can also remove the space going to that specific file.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited yesterday









              double-beep

              2,1382824




              2,1382824










              answered yesterday









              pranav-devpranav-dev

              331




              331























                  0














                  These two changes what you want:



                  // in package.json:


                  "rxjs": "^6.2.2" ==> "rxjs": "latest"
                  "typescript": "2.7.2" ==> "typescript": "2.8"



                  where ==> means to replace






                  share|improve this answer






























                    0














                    These two changes what you want:



                    // in package.json:


                    "rxjs": "^6.2.2" ==> "rxjs": "latest"
                    "typescript": "2.7.2" ==> "typescript": "2.8"



                    where ==> means to replace






                    share|improve this answer




























                      0












                      0








                      0







                      These two changes what you want:



                      // in package.json:


                      "rxjs": "^6.2.2" ==> "rxjs": "latest"
                      "typescript": "2.7.2" ==> "typescript": "2.8"



                      where ==> means to replace






                      share|improve this answer















                      These two changes what you want:



                      // in package.json:


                      "rxjs": "^6.2.2" ==> "rxjs": "latest"
                      "typescript": "2.7.2" ==> "typescript": "2.8"



                      where ==> means to replace







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited yesterday









                      double-beep

                      2,1382824




                      2,1382824










                      answered yesterday









                      Ali BahramiAli Bahrami

                      123212




                      123212























                          0














                          You can update your npm version to the latest, if it isn't, with:



                          npm update -g





                          share|improve this answer


























                          • this will update rxjs and the typescrip

                            – Hezy Ziv
                            yesterday
















                          0














                          You can update your npm version to the latest, if it isn't, with:



                          npm update -g





                          share|improve this answer


























                          • this will update rxjs and the typescrip

                            – Hezy Ziv
                            yesterday














                          0












                          0








                          0







                          You can update your npm version to the latest, if it isn't, with:



                          npm update -g





                          share|improve this answer















                          You can update your npm version to the latest, if it isn't, with:



                          npm update -g






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited yesterday









                          double-beep

                          2,1382824




                          2,1382824










                          answered yesterday









                          Hezy ZivHezy Ziv

                          211




                          211













                          • this will update rxjs and the typescrip

                            – Hezy Ziv
                            yesterday



















                          • this will update rxjs and the typescrip

                            – Hezy Ziv
                            yesterday

















                          this will update rxjs and the typescrip

                          – Hezy Ziv
                          yesterday





                          this will update rxjs and the typescrip

                          – Hezy Ziv
                          yesterday











                          0














                          I changed the version for rxjs and typescript. My package.json has the following entries
                          "typescript": "^2.7.2"
                          "rxjs": "^6.3.3",



                          I also had to upgrade angular cli.






                          share|improve this answer








                          New contributor




                          sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.

























                            0














                            I changed the version for rxjs and typescript. My package.json has the following entries
                            "typescript": "^2.7.2"
                            "rxjs": "^6.3.3",



                            I also had to upgrade angular cli.






                            share|improve this answer








                            New contributor




                            sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                            Check out our Code of Conduct.























                              0












                              0








                              0







                              I changed the version for rxjs and typescript. My package.json has the following entries
                              "typescript": "^2.7.2"
                              "rxjs": "^6.3.3",



                              I also had to upgrade angular cli.






                              share|improve this answer








                              New contributor




                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.










                              I changed the version for rxjs and typescript. My package.json has the following entries
                              "typescript": "^2.7.2"
                              "rxjs": "^6.3.3",



                              I also had to upgrade angular cli.







                              share|improve this answer








                              New contributor




                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.









                              share|improve this answer



                              share|improve this answer






                              New contributor




                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.









                              answered 7 hours ago









                              sthayamkerysthayamkery

                              1




                              1




                              New contributor




                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.





                              New contributor





                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.






                              sthayamkery is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                              Check out our Code of Conduct.























                                  0














                                  Your package.json has following lines:



                                  "rxjs": "^6.0.0",

                                  "typescript": "~2.7.2"


                                  This tells npm to install the following versions



                                  rxjs: Latest version in version 6 series which is 6.4.0



                                  typescript: Latest patched version in minor version 2.7 which is 2.7.2



                                  Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.



                                  So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as



                                  typescript: ^2.8.0



                                  or bump down the version of ngrx to something like



                                  ngrx: ~6.0.0 and



                                  do a fresh npm install.



                                  You can check the version number of the module installed by looking in following files:



                                  node_modules/rxjs/package.json and
                                  node_modules/typescript/package.json





                                  share|improve this answer




























                                    0














                                    Your package.json has following lines:



                                    "rxjs": "^6.0.0",

                                    "typescript": "~2.7.2"


                                    This tells npm to install the following versions



                                    rxjs: Latest version in version 6 series which is 6.4.0



                                    typescript: Latest patched version in minor version 2.7 which is 2.7.2



                                    Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.



                                    So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as



                                    typescript: ^2.8.0



                                    or bump down the version of ngrx to something like



                                    ngrx: ~6.0.0 and



                                    do a fresh npm install.



                                    You can check the version number of the module installed by looking in following files:



                                    node_modules/rxjs/package.json and
                                    node_modules/typescript/package.json





                                    share|improve this answer


























                                      0












                                      0








                                      0







                                      Your package.json has following lines:



                                      "rxjs": "^6.0.0",

                                      "typescript": "~2.7.2"


                                      This tells npm to install the following versions



                                      rxjs: Latest version in version 6 series which is 6.4.0



                                      typescript: Latest patched version in minor version 2.7 which is 2.7.2



                                      Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.



                                      So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as



                                      typescript: ^2.8.0



                                      or bump down the version of ngrx to something like



                                      ngrx: ~6.0.0 and



                                      do a fresh npm install.



                                      You can check the version number of the module installed by looking in following files:



                                      node_modules/rxjs/package.json and
                                      node_modules/typescript/package.json





                                      share|improve this answer













                                      Your package.json has following lines:



                                      "rxjs": "^6.0.0",

                                      "typescript": "~2.7.2"


                                      This tells npm to install the following versions



                                      rxjs: Latest version in version 6 series which is 6.4.0



                                      typescript: Latest patched version in minor version 2.7 which is 2.7.2



                                      Now RxJS module also installs the type definition files for TypeScript. The type definition file included in the rxjs module that got installed in your project is not compatible with typescript version installed in the same project.



                                      So as a solution in your package.json file you can either bump up the version of Typescript to say 2.8 as



                                      typescript: ^2.8.0



                                      or bump down the version of ngrx to something like



                                      ngrx: ~6.0.0 and



                                      do a fresh npm install.



                                      You can check the version number of the module installed by looking in following files:



                                      node_modules/rxjs/package.json and
                                      node_modules/typescript/package.json






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered 1 hour ago









                                      PraymPraym

                                      9941213




                                      9941213






















                                          Rifat Murtuza is a new contributor. Be nice, and check out our Code of Conduct.










                                          draft saved

                                          draft discarded


















                                          Rifat Murtuza is a new contributor. Be nice, and check out our Code of Conduct.













                                          Rifat Murtuza is a new contributor. Be nice, and check out our Code of Conduct.












                                          Rifat Murtuza is a new contributor. Be nice, and check out our Code of Conduct.
















                                          Thanks for contributing an answer to Stack Overflow!


                                          • Please be sure to answer the question. Provide details and share your research!

                                          But avoid



                                          • Asking for help, clarification, or responding to other answers.

                                          • Making statements based on opinion; back them up with references or personal experience.


                                          To learn more, see our tips on writing great answers.




                                          draft saved


                                          draft discarded














                                          StackExchange.ready(
                                          function () {
                                          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54434333%2ferror-ts1005-expected-typescript-angular-6-for-first-build-error-rxjs-insi%23new-answer', 'question_page');
                                          }
                                          );

                                          Post as a guest















                                          Required, but never shown





















































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown

































                                          Required, but never shown














                                          Required, but never shown












                                          Required, but never shown







                                          Required, but never shown







                                          Popular posts from this blog

                                          If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                                          Alcedinidae

                                          Can an atomic nucleus contain both particles and antiparticles? [duplicate]