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(arborist): node.target can be null when it is a file dep or symlink #7027

Merged
merged 8 commits into from
Dec 6, 2023

Conversation

ljharb
Copy link
Contributor

@ljharb ljharb commented Nov 26, 2023

This avoids a Cannot read properties of null (reading 'realpath') error when installing a tree that contains, eg, https://npmjs.com/has-package-exports which has a file dep in it.

May relate to other issues with similar errors; I'm happy to add a test but I'm not sure how to repro it outside of my project.

(I'll want to backport this as far back as possible once it lands in 10, so a test would be quite helpful to have)

@ljharb ljharb requested a review from a team as a code owner November 26, 2023 22:18
@wraithgar
Copy link
Member

Unfortunately the test is The Thing for this bug. Many PRs have been started but none provides a test that shows the root cause. Without that we're just fixing it by accident. We have to know why this happens to know if this fix is the right one.

@lukekarrys lukekarrys merged commit ae2d982 into npm:latest Dec 6, 2023
20 checks passed
@ljharb ljharb deleted the null-target branch December 6, 2023 19:30
@ljharb
Copy link
Contributor Author

ljharb commented Dec 6, 2023

<3 thank you!

@github-actions github-actions bot mentioned this pull request Dec 6, 2023
ljharb added a commit to ljharb/cli that referenced this pull request Dec 6, 2023
…ymlink (npm#7027)


Co-authored-by: Luke Karrys <luke@lukekarrys.com>
@ljharb ljharb added ws:arborist Related to the arborist workspace Release 10.x labels Dec 6, 2023
@ljharb
Copy link
Contributor Author

ljharb commented Dec 6, 2023

Created #7059 for v9.

ljharb added a commit to ljharb/cli that referenced this pull request Dec 8, 2023
ljharb added a commit to ljharb/cli that referenced this pull request Dec 16, 2023
ljharb added a commit to ljharb/cli that referenced this pull request Jan 16, 2024
ljharb added a commit to ljharb/cli that referenced this pull request Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release 10.x ws:arborist Related to the arborist workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants