Skip to content

Conversation

@Ravi-Rajpurohit
Copy link

No description provided.

@Ravi-Rajpurohit
Copy link
Author

Does this look good ?? Let me know if there are any changes.

}
const usedPM = whichPMRuns()
if (usedPM && usedPM.name !== wantedPM) {
if (usedPM && usedPM.name !== wantedPM && usedPM.version !== wantedVersion) {
Copy link
Member

Choose a reason for hiding this comment

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

what about when the version is not specified? In that case it shouldn't be checked, right?

Suggested change
if (usedPM && usedPM.name !== wantedPM && usedPM.version !== wantedVersion) {
if (usedPM && (usedPM.name !== wantedPM || wantedVersion && usedPM.version !== wantedVersion)) {

@zkochan
Copy link
Member

zkochan commented Feb 16, 2022

Not sure if we need this feature as I know that pnpm, for instance, may verify its own version, using the engines field in package.json. Maybe other package managers do it as well.

https://pnpm.io/package_json#engines

@jimmyko
Copy link

jimmyko commented May 4, 2022

@zkochan Though the engine field can verify its own version, the pnpm still updates the lock file if someone run pnpm i, it's better to show a warning message to developer

@andersonba
Copy link

+1


Though the engine field can verify its own version, the pnpm still updates the lock file if someone run pnpm i, it's better to show a warning message to developer

Exactly!

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.

4 participants