Currently I have TypeScript 1.0.3.0 version installed on my machine.
I want to update it to latest one i.e. 2.0.
How to do this with npm?
Currently I have TypeScript 1.0.3.0 version installed on my machine.
I want to update it to latest one i.e. 2.0.
How to do this with npm?
Try
npm install -g typescript@latest
. You can also usenpm update
instead of install, without the latest modifier.Just use the command
# npm update -g typescript
For update all global installed module, Use this command
# npm update -g
On Windows open command prompt (cmd)
Recommended:
This will install the latest typescript version if not already installed, otherwise it will update the current installation to the latest version.
And then verify which version is installed:
If you have typescript already installed you could also use the following command to update to latest version, but as commentators have reported and I confirm it that the following command does not update to latest (as of now)!
If you are on Windows and have Visual Studio installed you might have something in your PATH that is pointing to an old version of TypeScript. I found that removing the folder "C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\" from my PATH (or deleting/renaming this folder) will allow the more recent npm globally installed TypeScript version of tsc to work.
You should be able to do this by simply typing
npm install -g typescript@2.0
. If this does not work, I am beginning to wonder what version of node and npm you are on. Trynode -v
andnpm -v
to find these out. You should be on node >4.5 and npm >3