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

后端 未结 18 1959
北恋
北恋 2021-01-31 13:37

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

相关标签:
18条回答
  • 2021-01-31 13:45

    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. rxjs and "TypeScript" verstion like below screenshot

    3. Change like the below screenshot:

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

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

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

    0 讨论(0)
  • 2021-01-31 13:45

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

    0 讨论(0)
  • 2021-01-31 13:45

    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

    0 讨论(0)
  • 2021-01-31 13:47

    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.

    0 讨论(0)
  • 2021-01-31 13:49

    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.

    0 讨论(0)
  • 2021-01-31 13:50

    Just change the TypeScript dependency version to ^2.8

    0 讨论(0)
提交回复
热议问题