Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pack): detect unresolved package properly #3133

Closed
wants to merge 1 commit into from

Conversation

zepatrik
Copy link

@zepatrik zepatrik commented Apr 23, 2021

See bug report in #3132
The test case was failing before adjusting the check.

References

Fixes #3132

@zepatrik zepatrik requested a review from a team as a code owner April 23, 2021 13:23
@wraithgar
Copy link
Member

We'd prefer if the test didn't make real network calls if possible. Not sure what's happening here, read-package-json-fast adds this to the manifest, and pacote uses that to parse package.json files:

https://github.com/npm/pacote/blob/latest/lib/file.js#L29

https://github.com/npm/read-package-json-fast/blob/master/index.js#L32-L36

const add_id = data => {
  if (data.name && data.version)
    data._id = `${data.name}@${data.version}`
  return data
}

@zepatrik
Copy link
Author

Hm interesting, I did not check other packages but the one I have here is returned by pacote without _id...
I will close this PR then, as it probably needs an upstream fix.

@zepatrik zepatrik closed this Apr 23, 2021
@zepatrik zepatrik deleted the fix-pack-error-3132 branch April 23, 2021 14:45
@wraithgar
Copy link
Member

The root cause is that npm-pick-manifest returns different data than read-package-json-fast. We're discussing it to see what path to take.

Copy link

@RonSherfey RonSherfey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] pack wrongly errors with npm@7.11.0
3 participants