Check out example codes for "cannot find module typescript". It will help you in understanding the concepts better.

Code Example 1

# NPM Installation Method
npm install --global typescript # Global installation
npm install --save-dev typescript # Local installation

#Yarn Installation Method
yarn global add typescript # Global installation
yarn add --dev typescript # Local installation

Code Example 2

npm install -g typescript

Learn ReactJs, React Native from akashmittal.com