install npm typescript compiler code example Example 1: install typescript using npm npm install -g typescript Example 2: npm typescript npm install -g typescript