简体   繁体   中英

Node.JS EBADF error on npx create-react-app

I've been trying to get started learning React on my Mac. When I try to run npx create-react-app my-app it gives the following error:

`npm ERR! code EBADF npm ERR! syscall connect npm ERR! errno EBADF npm ERR! request to https://registry.npmjs.org/create-react-app failed, reason: connect EBADF 104.16.18.35:443

npm ERR: A complete log of this run can be found in: npm ERR!
/Users/Jeremy/.npm/_logs/2022-08-09T06_30_08_356Z-debug-0.log`

I've tried uninstalling and reinstalling node - making sure it was up-todate, etc, but no luck. I'm pretty stuck as a complete beginner just trying to follow a few tutorials. Any help would be greatly appreciated.

When I've googled code EBADF, it seems not many people have this issue. What am I missing?

I figured it out. The issue was that I was using a VPN that restricted the web traffic to http://registry.npmjs.org/create-react-app . Once I disable the VPN, everything worked as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM