Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating TypeScript version

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?

enter image description here


2 Answers

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
}
like image 70
PaulCrp Avatar answered Mar 07 '26 10:03

PaulCrp


You can run the below code to upgrade the version of your current project

npm i typescript@next -D
like image 43
bughou Avatar answered Mar 07 '26 10:03

bughou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!