Fix a bug in .pack and .packDeps

Calling `.pack` or `.packDeps` would throw if used inside a directory
with a package with no dependencies (or dev dependencies).