-
Notifications
You must be signed in to change notification settings - Fork 685
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
Moving npm-is into pwa-studio. #3106
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
revanth0212
added
the
version: Minor
This changeset includes functionality added in a backwards compatible manner.
label
Apr 6, 2021
revanth0212
commented
Apr 6, 2021
|
sirugh
added
the
needs-triage
A pull request or issue that needs to be triaged prior to being synced to JIRA
label
May 28, 2021
@revanth0212 what's up with this PR? |
anthoula
removed
the
needs-triage
A pull request or issue that needs to be triaged prior to being synced to JIRA
label
Jun 7, 2021
sirugh
reviewed
Jun 7, 2021
m2-community-project
bot
added
Progress: review
and removed
Progress: ready for review
labels
Jun 7, 2021
sirugh
previously approved these changes
Jun 10, 2021
supernova-at
approved these changes
Jun 11, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
pkg:npm-is
Progress: done
version: Minor
This changeset includes functionality added in a backwards compatible manner.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
npm-is a utility package that validates if a given script is executed using the given package manager. For instance,
pwa-studio
can only be installed usingyarn
and if you try to install usingnpm
it has to fail. @zetlen created this wonderful utility package a while ago which we have been using in the preinstall script to check validate if yarn is being used to install the package. Unfortunately in npm 7 update a critical piece of code that the package relies on has changed. Specifically the value ofprocess.env.npm_execpath
when it is invoked usingnpx
. The script extensively relies on the value ofprocess.env.npm_execpath
to make the decision about what package manager is used to initiating the script.Previously (npm 6 or less) if you initiated a script using
yarn
which internally usesnpx
the value ofprocess.env.npm_execpath
wasPATH_TO_THE_YARN_EXECUTABLE
but after the update, the value ofprocess.env.npm_execpath
has changed toPATH_TO_THE_NPX_EXECUTABLE
instead. Due to this the validation has failed andpwa-studio
installation fails with the following error:This PR addresses this issue by removing all references of
npm-is
and adding a note in the documentation to avoid usingnpm
.Related Issue
Closes PWA-1660
Acceptance
Should be able to validate if a script is initiated using a given package manager.
Verification Stakeholders
@zetlen
@dpatil-magento
Verification Steps
yarn install
and it should work fine.npm install
and it should fail.Checklist