Closed dsherret closed 6 years ago
I think this problem happens because of typescript dependency >=2.7.0
Because if you install dev version of typescript this version matching doesn't work for him
and ttypescript will install own typescript version. So if you install later another version of typescript, the installed typescript in ttypescript won't be deleted.
But if you install it like yarn add ttypescript@latest typescript@latest
it works nicely.
Actually I really don't understand why it have installed 2.9 in your case. It's nonsense
So I've just change typescript dependency to *
About peer dependency - npm doesn't install it automatically, just throw a warning about it.
Probably fixed in ttypescript@1.5.3
So, *
doesn't help
I've removed typescript dependency at all
Fixed in ttypescript@1.5.4
Awesome, I think that's the easiest solution. That's what I ended up doing in ts-nameof as well.
I'm pretty confident this will fix the problem so I'm going to close this issue. Thanks a lot for the fast fix!
Edit: Yup, just tried it and it works.
Hey, when having a typescript dependency of
^3.0.1
and installing the packages with yarn, it will create anode_modules/ttypescript/node_modules/typescript
package with a < 3.0 version. This will cause all the source files to be parsed with TS 2.9, which lead to a lot of confusion for me hah. It's a problem because theSyntaxKind
numbers have changed so the following happens:I found that replacing the
node_modules/ttypescript/node_modules/typescript
folder with a 3.0 version or installing via npm solves the issue.To fix this, would it be possible to change typescript to be a peer dependency? Or is there a better solution?