How to fix npm npm ERR! network request to https://registry.npmjs.org/create-vite failed, reason: connect ETIMEDOUT 2606:4700::6810:123:443?

huangapple go评论75阅读模式
英文:

How to fix npm npm ERR! network request to https://registry.npmjs.org/create-vite failed, reason: connect ETIMEDOUT 2606:4700::6810:123:443?

问题

I'm starting to learn React js and I'm trying to create my first app. When typing the command npm create vite@latest or npm create vite@latest my-app, or npm create-react-app my-app I get the same or similar error.

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-vite failed, reason: connect ETIMEDOUT 2606:4700::6810:123:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: C:\Users\USUARIO\AppData\Local\npm-cache\_logs23-08-04T15_54_15_416Z-debug-0.log

I didn't know how a proxy works so I did some research and found these commands:

npm config get proxy

  • null

npm config get https-proxy

  • undefined

I tried to fix the problem with npm delete cache, also with npm config delete proxy, netsh winsock reset, netsh int ip reset, ipconfig /release, ipconfig /renew, and ipconfig /flushdns, but still not working.

英文:

I'm starting to learn React js and I'm trying to create my first app. When typing the command npm create vite@latest or npm create vite@latest my-app, or npm create-react-app my-app I get the same or similar error.

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/create-vite failed, reason: connect ETIMEDOUT 2606:4700::6810:123:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in: C:\Users\USUARIO\AppData\Local\npm-cache\_logs23-08-04T15_54_15_416Z-debug-0.log

I didn't know how a proxy works so I did some research and found these commands:

npm config get proxy

  • null

npm config get https-proxy

  • undefined

I tried to fix the problem with npm delete cache, also with npm config delete proxy, netsh winsock reset, netsh int ip reset, ipconfig /release, ipconfig /renew, and ipconfig /flushdns, but still not working.

答案1

得分: 0

我找到了解决方案:

npm install -g npm@latest

对我有效。

英文:

I found a solution:

npm install -g npm@latest

It worked for me.

huangapple
  • 本文由 发表于 2023年8月5日 00:04:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/76837551.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定