-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Typescript@next and npm linked node_modules #9566
Comments
looks like we need to get real path when enumerating the types directories. |
This is also an issue on OSX. The
I use my own gulp-npmworkspace to manage large projects and this is a show-stopper for me. Currently, the only workaround is to use physical paths in the package.json and call |
Same root cause as #9771; the path machinery as it stands is fine as long as we don't freak out over importing two files with the same UMD global |
Hmm, I'm not so sure the path machinery is fine actually.With this
I get these errors
shujin is an npm linked dependency and for some reason typescript uses its modules even though node_modules is excluded. Should I open a new issue? |
I'm still getting this problem with a node_module that has been linked to the project and has a |
I think this is going to be fixed in 2.0.1, but that hasn't been released yet? |
I'm using |
You're right @pocesar, I can't get it working either. I'm switching back to using DefinitelyTyped directly. No matter how I try to organise my packages, it doesn't work when I have a dependency symlinked. It still brings in the shared @types/xxx from the dependency and I get the duplicates. |
This bug still exists on tsc version 2.0.3. it should be reopened. |
@RyanCavanaugh this bug still exists for @types sub-submodules in a |
it happens when your for example, in my new version of that works fine when I |
the same issue occurs if you have a relative link, such as: this is a regression from typescript 1.x, where you could have relative links no problem. |
Same issue here. Seems like tsc also doesn't respect "typeRoots" in tsconfig.json. Still looks for types outsides of the folders listed there. |
@jpzwarte this is a closed issue, marked as "fixed". if you are still running into issues please file a new ticket, include the version you are using, and enough details to allow us to diagnose the issue. |
Yes, I got this...though tools are different, it seems the same reason. We are using But
Then when run
Any solution/tricks for now? Update: #9091 also is the same issue. |
on windows, here is a workaround using a batch script with robocopy. I wrote this because the :rerunloop
@echo watching for changes to project files.............. (Ctrl-C to cancel)
@rem *******************************
@rem npm link fix : copy code into node_modules of the consuming project: xlib --> blib and slib
@robocopy ..\xlib\src ..\blib\node_modules\xlib\src *.* /MIR /NJH /NJS /NDL /XD .git
@if NOT "%errorlevel%" == "0" (
@rem copy occured, so copy both
@robocopy ..\xlib\dist ..\blib\node_modules\xlib\dist *.* /MIR /NJH /NJS /NDL /XD .git
@robocopy ..\xlib\src ..\slib\node_modules\xlib\src *.* /MIR /NJH /NJS /NDL /XD .git
@robocopy ..\xlib\dist ..\slib\node_modules\xlib\dist *.* /MIR /NJH /NJS /NDL /XD .git
@rem set the src dirs readonly
@attrib +R ..\blib\node_modules\xlib\src\* /S /D
@attrib +R ..\slib\node_modules\xlib\src\* /S /D
)
@rem *******************************
@rem another alternative way to fix npm link issues: copy source code to the consuming project and have the consuming project treat it as a native part of it's project
@robocopy .\dtll-interop\src\mirror-source .\dtll-app-browser\src\dtll-interop *.* /MIR /NJH /NJS /NDL
@if NOT "%errorlevel%" == "0" (
@rem copy occured, so copy both
@robocopy .\dtll-interop\src\mirror-source .\dtll-server-dashboard\src\dtll-interop *.* /MIR /NJH /NJS /NDL
@rem and set reseults readonly
@attrib +R .\dtll-server-dashboard\src\dtll-interop\* /S /D
@attrib +R .\dtll-app-browser\src\dtll-interop\* /S /D
)
@timeout /t 1 /nobreak > NUL
@goto rerunloop |
@RyanCavanaugh still having this problem on 2.2-dev.20170131, please reopen
unless #6496 is going to be the 'main issue' for this problem (lingering for a lot of time by now), but this shouldn't be tagged as fixed because it isn't |
this is still not working! ERROR in [at-loader] ../corifeus-web-material/node_modules/@types/hammerjs/index.d.ts:9:5
TS2300: Duplicate identifier 'export='.
ERROR in [at-loader] ../corifeus-web-material/node_modules/@types/hammerjs/index.d.ts:71:6
TS2300: Duplicate identifier 'RecognizerTuple'.
ERROR in [at-loader] ../corifeus-web-material/node_modules/@types/hammerjs/index.d.ts:139:15
TS2300: Duplicate identifier 'HammerInput'.
ERROR in [at-loader] ../corifeus-web-material/node_modules/@types/hammerjs/index.d.ts:217:15
TS2300: Duplicate identifier 'MouseInput'.
|
fyi there is a bug in it used to work for me, but after switching my npm versions around it's broken again due to the issue I linked above. who knows when that will get fixed.... |
whit this settings it works multiple linked projects |
@patrikx3 thanks it works, assuming you don't run into the npm bug I mentioned above. for those looking at Patrik's tsconfig file, the important lines are:
|
@jasonswearingen this solution doesn't work for me unfortunately. Has anyone found a solution to this problem? It really impedes being able dev npm modules locally. |
you can try delete the node_modules sometimes. i use 2 repos. a linked and a non linked. will not be perfect always. |
besides i use yarn, but that not helping anyways ciao!! |
i posted more details on my workarounds here: #6496 (comment) |
The workaround posted by @mhegazy in #11916 (comment) solved this for us when using linked modules in a lerna project! |
I'm this problem on windows 10. I have a linked node_module that was created using
npm link @pocesar/moip2
, Typescript@next is trying to use the typings in the linkednode_modules\@types\bluebird\index.d.ts
TypeScript Version: nightly
The
tsc --listFiles
shows:My local tsconfig.json is:
The tsconfig.json in moip2:
Do I need to use excludes? Doesn't files and excludes cancel each other?
Expected behavior:
Should ignore the node_modules on linked packages as well
Actual behavior:
The exclude option is being ignored for npm link'd packages
The text was updated successfully, but these errors were encountered: