Replace path.existsSync by fs.existsSync.