Search code examples
npmyarnpkg

How to install create react app via http?


For some network issue that I'm working in, I couldn't install packages properly via https protocol. Is there any way I could install create-react-app via HTTP?

I've tried this using offical git URL but it doesn't work either.

"dependencies": {
    "create-react-app" : "http://github.com/facebook/create-react-app.git"
  }

Solution

  • GitHub will not permit you to use HTTP. This is good. They don't want people trying to use man-in-the-middle attacks on users of the site to inject malware etc.

    If the git protocol isn't working for you either, you can try the SSH protocol: npm install git@github.com:facebook/create-react-app.git

    If that doesn't work and the problem you're having with HTTPS is cert validation, a less-good solution is to temporarily turn off ssl-strict in npm.

    If you're having a larger "network issue" such that you can't get to GitHub over HTTPS at all (even in a web browser, let's say), I'd recommend fixing that rather than trying to work around it. In that situation, it's likely far more than just that is broken for you.