Unfortunately your answer is not sufficient for those who use react-scripts-ts or any other dependencies which require the older version of the typescript. I have added to my package dependency typescript ^2.6.2, but ts-loader still shows typescript 2.5.3, because "react-scripts-ts" has a dependency "typescript":"~2.5.3", so somehow that dependency takes precedence.
The actual solution that I found is creating npm-shrinkwrap.json
file where I override subdependency of react-scripts-ts to the correct dependency, something like this:
{
"dependencies":
{
"react-scripts-ts":
{
"dependencies":{
"typescript": { "version": "2.6.2" }
}
}
}
}
After creating this file, I remove folder node_modules
and execute npm install
If you're not sure which package in your dependency tree depends on specific version of some package, you can find it in package-lock.json
file