I run npm install -g typescript to update my TypeScript version globally, but when I run ng v in my Angular project, I still see an old version. Why is that? How can I consistently upgrade this?

To upgrade the typescript version of your Angular project to the latest stable version, use :
npm i typescript@latest --save-dev
You can verify the upgrade in your package.json file :
"devDependencies": {
// ...
"typescript": "^5.2.2" // typescript current installed version
}
You can run the below code to upgrade the version of your current project
npm i typescript@next -D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With