Ensure the package cache directory exists
merged error checking
merge
2.2.1