You should do npm install typescript@'>=2.7.2 <2.8.0'
. This will install the correct typescript your project needs. Make sure you run this inside your Angular project.
On Windows, you should use double quotes instead of single quotes, like so:
npm install typescript@">=2.7.2 <2.8.0"
Otherwise, you’ll get The system cannot find the file specified.
.