Dina M.
Dina M.

Reputation: 328

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

Upvotes: 14

Views: 29248

Answers (2)

PaulCrp
PaulCrp

Reputation: 978

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
}

Upvotes: 18

bughou
bughou

Reputation: 152

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

npm i typescript@next -D

Upvotes: 11

Related Questions