try using path.resolve(path.join(path, entry))