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: throw if not ENOENT #6

Merged
merged 1 commit into from
Jul 20, 2022
Merged

Fix: throw if not ENOENT #6

merged 1 commit into from
Jul 20, 2022

Conversation

JonathanUsername
Copy link

We had a tricky bug at work using pnpm as it seemed to not read publicHoistPattern on some users' machines.
We worked out that it wasn't using or finding the .npmrc file. After lots of debugging we worked out that it should be loading the file but the settings were still empty/default.

I logged out the error that is swallowed on this line and I found:

Error: Failed to replace env in config: ${GITHUB_TOKEN}

I can understand the ENOENT errors being ignored since in many cases you're loading files that may not have been created, but in this case we were failing to interpolate an env variable and had no idea that was the issue. Since this was so painful to track down, I wanted to make a PR to try to improve the situation for anyone else.

Maybe there's a reason why these errors are always swallowed even if they're not ENOENT, but I can't imagine why. Still, I imagine this is a breaking change so I'm happy to discuss it. But the fact that it's swallowed at the npm-conf level means there's really nothing to PR against in the main repo.

Copy link
Member

@zkochan zkochan left a comment

Choose a reason for hiding this comment

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

I think it is fine

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.

2 participants