Skip to content

Fallback to version if resolved and from are missing in package-lock #205

@bschlenk

Description

@bschlenk

At my company we use a modified version of npm that doesn't write resolved or from fields in package-lock. It does have the version field. Is there any reason not to fall back to version if either of these fields don't exist?

return (
relevantStackEntry.dependencies[packageDetails.name].resolved ||
relevantStackEntry.dependencies[packageDetails.name].from
)

Locally I modified this line to be

return (
  relevantStackEntry.dependencies[packageDetails.name].resolved ||
  relevantStackEntry.dependencies[packageDetails.name].from ||
  relevantStackEntry.dependencies[packageDetails.name].version
)

and it started working. Otherwise it writes out an empty package.json and doesn't install anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions