Resolve the path of a module like require.resolve() but from a given path