-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix(core): ensure proper install for git dependency using Yarn classic and npm #4403
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(core): ensure proper install for git dependency using Yarn classic and npm #4403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll also need to do this for Yarn classic as well since it has the same behaviour.
packages/acceptance-tests/pkg-tests-specs/sources/protocols/git.test.js
Outdated
Show resolved
Hide resolved
That error is happening because the content of the file is 'module.exports
=
42;' |
thanks @merceyz. i had to add that output temporarily to understand why windows was failing with the syntax error. next commit should sort things out 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, could you update the description to match the final state of the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
…c and npm (#4403) * fix(core): ensure proper install for git dependency with npm prepack * refactor: don't use variables outside of the test * test: expect on the part that rejects * chore: versions * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * fix(core): ensure proper install for git dependency with prepack * chore: style Co-authored-by: merceyz <[email protected]>
What's the problem this PR addresses?
When a git dependency is specified that doesn't exist in the yarn cache it will be:
pack
command to create a tarball that can be installedpack
lifecycle scripts exist (i.e.;prepack
,postpack
) these will also be executedIf a
pack
lifecycle script depends on dev dependencies to be installed this process can fail in cases where environment variables like the following are present:NODE_ENV=production
(npm and Yarn classic)NPM_CONFIG_PRODUCTION=true
(npm)This process of creating the installable tarball should guarantee that all dependencies are available and not allow environment variables to change what is installed.
How did you fix it?
This can be fixed by removing the environment variables described above from the subprocess spawned to handle the Yarn classic and npm install steps when preparing an external project.
Checklist