Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeRoots not inferred correctly? #308

Closed
42shadow42 opened this issue Apr 13, 2017 · 4 comments
Closed

typeRoots not inferred correctly? #308

42shadow42 opened this issue Apr 13, 2017 · 4 comments

Comments

@42shadow42
Copy link

42shadow42 commented Apr 13, 2017

I've experienced an issue similar to Issue #283 , in my case the node_modules folder is not at node_modules/@types, instead it is at ../node_modules/@types.

According to the documentation at: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html

@types, typeRoots and types

By default all visible “@types” packages are included in your compilation. Packages in node_modules/@types of any enclosing folder are considered visible; specifically, that means packages within ./node_modules/@types/, ../node_modules/@types/, ../../node_modules/@types/, and so on.

This fix appears to have resolved the base case, but not the recursive search scenario. What would it take to make this fix apply recursively.

@blakeembrey
Copy link
Member

Can you please verify that this works with tsc? I'm not really sure where it'd need to be fixed for that feature, so I'd be happy to accept a PR.

@42shadow42
Copy link
Author

42shadow42 commented Apr 13, 2017

Yes, tsc appears to behave as described. I'm not really in a great place to contribute the fix, but I'd assume a starting point would be to fix compatibility with windows.

In the meantime for anyone encountering this issue you can easily workaround the issue by being being explicit about typeRoots when working with ts-node.

@42shadow42
Copy link
Author

42shadow42 commented Apr 13, 2017

I updated to 2.1.2 and no longer have this problem directly using ts-node. I think it may have been fixed by #285.

@paqogomez
Copy link

paqogomez commented Oct 27, 2017

Could this error have resurfaced? I'm on typescript 2.5.3. On my mac the project compiles fine, but on the windows side I get:

[22:08:24]  build dev started ...
[22:08:24]  clean started ...
[22:08:24]  clean finished in less than 1 ms
[22:08:24]  copy started ...
[22:08:24]  transpile started ...
[22:08:29]  typescript error
[22:08:29]  typescript error
        Cannot find type definition file for 'node'.

        Cannot find type definition file for 'pako'.

I've recreated this on two different windows machines. I was hoping i'd just missed installing something, but this error seems to detail out exactly what I'm experiencing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants