如何将 Typescript 升级到最新版本? [英] How to upgrade Typescript to the latest version?

查看:426
本文介绍了如何将 Typescript 升级到最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台装有 OS X 10.8.2 的 MacBook Pro前段时间我安装了 Typescript,今天我想将该安装升级到可用的最新版本(到目前为止,v0.8.3).我从终端写了这个命令:

I have a MacBook Pro with OS X 10.8.2 Some time ago I installed Typescript and today I'd like to upgrade that installation to the latest version available (so far, v0.8.3). I wrote this command from the terminal:

sudo npm install -g typescript

但这就是我在显示器上看到的:

But this is what I got on the display:

npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/typescript
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
typescript@0.8.0 /usr/local/lib/node_modules/typescript

这是否意味着我的计算机上仍然安装了 0.8.0 版本?我试图查看 tsc 命令是否有 -v-version 参数但我没有找到它,所以我仍然不确定我是否已将 Typescript 升级到最新版本,或者如果我仍然坚持使用旧版本.

Does this means that I still have version 0.8.0 installed on my computer? I tried to see if the tsc command has a -v or a -version parameter but I haven't found it, so I still uncertain if I have upgraded Typescript to the latest release or if I'm still stuck with an older version.

推荐答案

我刚刚意识到我使用的是旧版本的 npm.我已经将 npm 升级到最新版本,然后重新安装了 typescript,现在我的电脑上安装了最新版本的 typescript.

I just realised that I was using an old version of npm. I have upgraded npm to the latest version, then re-installed typescript and now I have the latest version of typescript installed on my computer.

这篇关于如何将 Typescript 升级到最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆