The values for the dependencies could be strings intead of objects, so
add a `try` block to take care of that.
Also set `dep.path` to `""` if the dependency contains a key `path` to
make sure that the cache isn't invalidated due to change in workspace.
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>