stefanpenner / hash-for-dep

7 stars 11 forks source link

Handle optionalDependencies. #38

Closed rwjblue closed 6 years ago

rwjblue commented 6 years ago

When a package is installed by npm, any of its optionalDependencies are added to the packages own dependencies hash. Unfortunately, this means that we will discover things in dependencies that are not actually present in the node_modules heirarchy.

This commit handles the specific error condition when a package cannot be found and simply returns null, if the package is missing it (by definition) cannot affect the host packages cache key (which is why it is ok to just ignore missing packages).

Fixes #20

Turbo87 commented 6 years ago

@rwjblue CI here is only testing Node 0.10 and 0.12. maybe we should adjust that first before merging this?

rwjblue commented 6 years ago

@Turbo87 - Seems unrelated to these changes, but taken care of in https://github.com/stefanpenner/hash-for-dep/pull/39 (and this PR has been rebased to re-run CI).