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

raise when a path dependency is absolute #5869

Merged
merged 2 commits into from
Oct 11, 2022

Conversation

jakecoffman
Copy link
Member

According to the NPM docs, a path dependency can be relative or absolute.

Absolute path dependencies can never be resolved by Dependabot and are resulting in EACCES errors when it tries to create files in various places around the update container that it doesn't have access to. For instance there are a considerable amount of errors trying to create /Users which is probably a macOS path in the manifest.

So I think our best option here is to throw an appropriate error to bring it to the user's attention.

@jakecoffman jakecoffman requested a review from a team as a code owner October 11, 2022 13:24
Copy link
Member

@jurre jurre left a comment

Choose a reason for hiding this comment

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

Should we only do this when path.start_with?("/") or for any path that we cannot resolve?

@jakecoffman
Copy link
Member Author

@jurre True, maybe I'll end up removing this with a more general solution.

We do already have this code which tries to fill out any dependencies it couldn't fetch. It seems like I could just add a raise there when there's no lockfile present.

I'll find an example that hits that case and take another pass at it and see if I can remove the special case in this PR.

Co-authored-by: Landon Grindheim <landon.grindheim@gmail.com>
@jakecoffman
Copy link
Member Author

Screen Shot 2022-10-11 at 9 31 29 AM

@jakecoffman jakecoffman merged commit 4b27eaa into main Oct 11, 2022
@jakecoffman jakecoffman deleted the jakecoffman/npm-absolute-path-dep branch October 11, 2022 14:32
@pavera pavera mentioned this pull request Oct 31, 2022
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.

None yet

3 participants