The personal blog of Jonathan Nacionales

Installing TypeScript on Ubuntu 14.04

I had recently had to use Typescript on an Ubuntu machine, and I could not get it to work. I eventually found out how to fix it; so, I thought I would use this blog post as an opportunity to document the process in case someone else runs into the same problem.

Building

Ensure that you have Git and Node.js installed

Clone a copy of the repo:

Change to the TypeScript directory:

Install Jake and dev dependencies

Make Typscript use nodejs instead of node

At this point, you have installed typescript successfully. However, you need to make it use nodejs instead of node. I know of two approaches:

Edit /usr/local/bin/tsc

Change update-alternatives

I suggest you change update-alternatives. However, it will also make all calls to node use nodejs, which may cause you problems. Pick whichever one makes more sense for you.

Edit /usr/local/bin/tsc

Change

To this

Change update-alternatives

You can update your alternatives with the following command line argument:

One thought on “Installing TypeScript on Ubuntu 14.04”

Hi, none of the ending steps work for me. For the first step I don’t find such a file to change its contents (/usr/local/bin/tsc) and for the second step it replying with `update-alternatives: error: alternative link /usr/bin/node is already managed by node`.