-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
How to block typescript 2.0 from walking up all parent directories while resolving modules? #13992
Comments
use use |
Thank you! Used "typeRoots": ["./typings"] and it resulted in error TS2688: Cannot find type definition file for 'globals'. Specifying --types didn't fix this error. |
|
@zakimaksyutov Typings puts things under two directories (globals vs modules) - try with |
Is there real solution ? I've tested all suggested options but with no luck.. compilation failed because in parent |
I had the same issue: |
@mhegazy Why did you close this? There is no actual solution, just a couple of suggested hacks. It is a valid feature request, if not an outright bug. |
As far as I know, using |
Here's the stupid fix we are now using:
|
Upgraded to Typescript 2.0 (2.1.6) and it started giving "Duplicate identifier" errors. After taking a closer look it turned out that Typescript started importing @types from all upper directories (essentially other projects).
What should be the configuration to let Typescript to ignore upper node_modules?
src
└── node_modules << *** how to ignore it? ***
└── @types
└── my.app << *** how to build this folder and down only? ***
└── node_modules
└── @types
EDIT: Here is an example of error I'm getting:
typings/globals/mocha/index.d.ts(30,13): error TS2300: Duplicate identifier 'describe'. ../../../node_modules/@types/jasmine/index.d.ts(9,18): error TS2300: Duplicate identifier 'describe'.
listFiles: true shows @types/jasmine being imported from upper folder:
C:/src///<my.app>/typings/globals/mocha/index.d.ts
C:/src/node_modules/@types/jasmine/index.d.ts
If I rename upper node_modules folder then build succeeds.
http://stackoverflow.com/questions/42150920/how-to-block-typescript-2-0-from-walking-up-all-parent-directories-while-resolvi
The text was updated successfully, but these errors were encountered: