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
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
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:
"rxjs": "^6.0.0" to "rxjs": "6.0.0"npm update in your projectNo need to change typescript version.(Mine: "typescript": "~2.7.2")
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.
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.
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
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.