I asked this question on StackOverflow, but it’s not getting any attention and I need some guidance on this. Pasting the question here.
In my app, I have these dependencies:
typeorm-linq-repository AS A LOCAL INSTALL (
"typeorm-linq-repository": "file:../../../IRCraziestTaxi/typeorm-linq-repository" ), who has a dev dependency AND a peer dependency of TypeORM
The reason I use a
"file:" installation of typeorm-linq-repository is that I am the developer and test changes in this app prior to pushing releases to npm.
I was previously using node ~6.10 (npm ~4), so when I used the
"file:" installation, it just copied the published files over, which is what I want.
However, after upgrading to node 8.11.3 (npm 5.6.0), it now links the folder rather than copying the published files.
Note, if it matters, that my environment is Windows.
The problem is this: since both my app and the linked typeorm-linq-repository have TypeORM in their own node_modules folders, TypeORM is being treated as a separate “instance” of the module in each app.
Therefore, after creating a connection in the main app, when the code that accesses the connection in typeorm-linq-repository is reached, it throws an error of
Connection "default" was not found. .
I have searched tirelessly for a solution to this. I have tried
--preserve-symlinks , but that does not work.
The only way for me to make this work right now is to manually create the folder in my app’s node_modules and copy applicable files over, which is a huge pain.
How can I either tell npm to NOT symlink the
"file:" installation or get it to use the same instance of the TypeORM module?