Skip to content

NPM: skip blank "file:" references in path dependencies#6229

Merged
jakecoffman merged 3 commits intomainfrom
jakecoffman/fix-npm-eacces-path-dependency
Nov 29, 2022
Merged

NPM: skip blank "file:" references in path dependencies#6229
jakecoffman merged 3 commits intomainfrom
jakecoffman/fix-npm-eacces-path-dependency

Conversation

@jakecoffman
Copy link
Copy Markdown
Member

In NPM when you add a path dependency it can result in a blank "file:" entry in the package-lock. The code here was taking that and calling File.join resulting in /package.json which later creates an EACCES error when it tries to write the package.json to the root directory.

It seems these blank file: sections are just for the parent dependency, so we can safely skip over them.

@jakecoffman jakecoffman requested a review from a team as a code owner November 28, 2022 22:05
@jakecoffman jakecoffman force-pushed the jakecoffman/fix-npm-eacces-path-dependency branch from 46845c1 to 5016455 Compare November 28, 2022 22:12
@jakecoffman jakecoffman force-pushed the jakecoffman/fix-npm-eacces-path-dependency branch from a25c1d9 to 3ffdf52 Compare November 28, 2022 22:30
@jakecoffman jakecoffman merged commit e2151cf into main Nov 29, 2022
@jakecoffman jakecoffman deleted the jakecoffman/fix-npm-eacces-path-dependency branch November 29, 2022 14:13
@jeffwidman
Copy link
Copy Markdown
Member

Nice find!

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.

3 participants