the path.resolve is not getting passed to the reduce function somehow?