Changed path.exists to fs.exists.