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

后端 未结 18 1910
北恋
北恋 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:59

    I had to uninstall and reinstall angular CLI.

    npm uninstall -g @angular/cli angular-cli
    npm cache clean
    npm install -g @angular/cli@latest
    npm install -g @angular/cli@latest
    
    0 讨论(0)
  • 2021-01-31 14:01

    Today I faced the same issue. None of the above answers worked except a comment from one @Nasreen Ustad. So what you have to do is:

    1. Go to package.json and modify "rxjs": "^6.0.0" to "rxjs": "6.0.0"
    2. Run npm update in your project

    No need to change typescript version.(Mine: "typescript": "~2.7.2")

    0 讨论(0)
  • 2021-01-31 14:01

    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.

    0 讨论(0)
  • 2021-01-31 14:06

    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.

    0 讨论(0)
  • 2021-01-31 14:06

    Check your typescript version with below command.

    ~ tsc --version Version 3.3.3

    As this is the latest typescript version, I've upgraded the project angular version to 7 by running below command in project home folder. It solved the issue.

    ~]# ng update @angular/cli @angular/core

    0 讨论(0)
  • 2021-01-31 14:08

    Step 1 : Go to package.json and modify "rxjs": "^6.0.0" to "rxjs": "6.0.0"

    Step 2 Run npm update in your project.

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