That seems pretty normal, if I'm in a subdirectory of my project and install a dependency, it makes sense that it would install it in the root of my project where the node_modules/ folder is.
When I use git in a subdirectory of my project, it looks for .git/ up the directory tree until it finds it.
When I use git in a subdirectory of my project, it looks for .git/ up the directory tree until it finds it.