You can use the `ComponentRegistrar` by injecting `ComponentRegistrarInterface` and get a module's directory like this: $path = $this->componentRegistrar->getPath(ComponentRegistrar::MODULE, 'Your_Module');