fix: create-react-app slow behind corporate proxies#10419
Open
AriPerkkio wants to merge 1 commit intofacebook:mainfrom
Open
fix: create-react-app slow behind corporate proxies#10419AriPerkkio wants to merge 1 commit intofacebook:mainfrom
AriPerkkio wants to merge 1 commit intofacebook:mainfrom
Conversation
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #10403. This PR speeds up
npx create-react-appby six minutes when run behind a corporate proxy.What:
NPM has a bug where it acts really slow when run via
child_processin an environment behind corporate proxy. Similar issues:Likely caused by sindresorhus/got#79.
With current version of CRA it takes 6 minutes additional time when
npx create-react-appis run.Use this to test whether your environment is affected:
This command takes 3 minutes to run in such environments.
How:
There is a work-around . If
NO_UPDATE_NOTIFIERis available as environment variablenpminternally skips some checks and moves on. Setting this variable"true"is something I always do to my work machines - but CRA cannot expect all developers to do this manually.https://github.com/yeoman/update-notifier/blob/master/index.js#L43
This PR adds
NO_UPDATE_NOTIFIERto thoserequire('child_process').execSync('npm ...')calls.Link to child_process docs for busy people
Test Plan:
As this can only be reproduced when in environment behind corporate proxy this cannot be tested easily. I tested this manually in such environment. Debug logs are wrapped around these lines:
create-react-app/packages/create-react-app/createReactApp.js
Line 198 in 0f6fc2b
create-react-app/packages/create-react-app/createReactApp.js
Line 1012 in 0f6fc2b
Without the fix:
With the fix:
All comments are welcome. 👍