I added the type check because `path.resolve` will throw a `TypeError` if a non-string argument is provided (previous versions of Node ignored invalid arguments).