fix Yarn 1 erroring on parent npmrc files with undefined vars#6883
fix Yarn 1 erroring on parent npmrc files with undefined vars#6883jakecoffman merged 3 commits intomainfrom
Conversation
|
Npm handles this a bit differently - instead of removing any variables, it only includes in the lines it needs into an .npmrc and then the content is written out into a temporary directory when performing updates And it looks like Yarn v1 does the same thing You may need to update the way we add these these lockfiles to the temporary directory so that all of the .npmrc files are added and not just the 1 |
|
@Nishnha Yarn is using |
|
I created a Yarn 1 smoke test which also tests this issue since it required a clone to have certain files on disk, and I wasn't sure how I'd achieve that in the rspec tests: dependabot/smoke-tests#45 |
If a repo has multiple .npmrc files, Dependabot only rewrites one of them to remove variables. NPM doesn't seem to have an issue with this, I assume it's just expanding undefined vars to
"", but Yarn 1 is not ok with that and errors.To fix this, I've added some code to rewrite all of the .npmrc files and remove the variables.
Still trying to figure out if there's a way to test this in this project, I have a CLI test that is passing with this change.