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

[area/nodejs] Take engines property into account when engine-strict appear in .npmrc file #9249

Merged
merged 4 commits into from Mar 22, 2022

Conversation

Zaid-Ajaj
Copy link
Contributor

@Zaid-Ajaj Zaid-Ajaj commented Mar 20, 2022

Description

Fixes #9201

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • Yes, there are changes in this PR that warrants bumping the Pulumi Service API version

@Zaid-Ajaj Zaid-Ajaj marked this pull request as ready for review March 20, 2022 14:06
// This is what node does as described in the npm docs
// https://docs.npmjs.com/cli/v8/configuring-npm/npmrc#comments
return ini.parse(npmRc);
} catch {
Copy link
Member

Choose a reason for hiding this comment

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

Wonder if we should just allow this error to bubble up. It's probably something like bad permissions and having that explict error might be better than silently ignoring if engine-strict is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I followed the same approach as with packageObjectFromProjectRoot where we just return an empty object if we are unable to read or parse it. Do you think it is likely that an error would occur when we are only reading the file?

Copy link
Member

Choose a reason for hiding this comment

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

Only errors I can think likely are permission issues. It's probably rare enough to not really worry either way.

Copy link
Member

Choose a reason for hiding this comment

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

Would we have a way of raising a warning here instead - to help the user if it is some kind of permissions issue?

Copy link
Member

@danielrbradley danielrbradley left a comment

Choose a reason for hiding this comment

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

This looks good from a nodejs point of view 👍

@Zaid-Ajaj
Copy link
Contributor Author

thanks @danielrbradley for the review 🙏

@Zaid-Ajaj Zaid-Ajaj merged commit 36b03bc into master Mar 22, 2022
@pulumi-bot pulumi-bot deleted the take-npmrc-into-account branch March 22, 2022 11:27
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.

Pulumi not respecting engines property and npmrc file
3 participants