Skip to content

checkLatestVersion fails when behind a corporate proxy #10403

@johnlister

Description

@johnlister

Describe the bug

Currently create-react-app calls checkLatestVersion which directly tries to download the latest version from the npm registry, this fails when behind a corporate firewall that requires you connect through a proxy. As such it is impossible to run the rest of the application to generate a react app.

Did you try recovering your dependencies?

n/a

Which terms did you search for in User Guide?

proxy

Environment

Environment Info:

current version of create-react-app: 4.0.1
running from C:\Users\john.lister\AppData\Roaming\npm\node_modules\create-react-app

System:
OS: Windows 10 10.0.17763
CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Binaries:
Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 87.0.4280.141
Edge: Spartan (44.17763.831.0)
Internet Explorer: 11.0.17763.771

Steps to reproduce

run
npx create-react-app myapp
or
yarn create react-app myapp

Expected behavior

Shows the welcome screen

Actual behavior

Hangs immediately due to corporate firewall blocking direct outbound internet connections.

Suggestion
Can a configuration parameter be added to use the "slower" method of using npm to check the version or if "--use-npm" specified force use of npm for checking version? alternatively switch to a library such as "request" that supports configuring a proxy using environment variables. Most other CLI tools support the standard HTTP_PROXY and HTTPS_PROXY environment variables

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions