英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论