I'm installing ts-loader to work with webpack.
Does someone know how to choose which typescript version to use ?
No matter what I do, I always get a message saying
ts-loader: Using [email protected] and /app/tsconfig.json
I intend to use typescript@2 but I have no clue how to tell ts-loader to use the proper version...
Thanks
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With