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
tsc doesn't resolve module specified in the typeRoots #13581
Comments
TypeRoots is useful for global declarations, things that you do not Seems like this is not what you are looking for, what you need is Path mapping: {
"compilerOptions": {
"moduleResolution": "node",
"module": "es6",
"target": "es6",
"baseUrl": "./",
"paths": {
"*" : ["node_modules/custom/*"]
}
}
} This tells the compiler to look under |
Thanks a lot for you quick reply. As I understand, the And is my understanding correct that both "typeRoots" and "types" is used for global modules resolve? |
that is correct. I would not think about |
Got it, thanks. Where can I read about all supported patterns for |
What if the node_modules including node_modules/@types are outside the source directory alltogether?
this doesn't work (ts 2.1.6) |
|
typeRoots are used only for global namespaces. See microsoft/TypeScript#13581
typeRoots are used only for global namespaces. See microsoft/TypeScript#13581
TypeScript Version: 2.1.5
I have the following directory structure:
The content of
index.d.ts
is the following:I reference this module in
a.ts
:import {Rembo} from 'rembo';
The
package.json
is the following:The problem is that
rembo
module can't be resolved. When compiled, I get the following result:$ tsc --traceResolution
I don't understand why the error, since it reports then:
The text was updated successfully, but these errors were encountered: