尝试通过NPM安装样式组件时的网络错误

发布于 2025-01-26 14:51:30 字数 1198 浏览 2 评论 0原文

嗨,大家好,我正在努力建立环境。我已经从
开始了一个React项目,

npx create-react-app PROJECTNAME

我现在正在考虑使用样式的组件。但是,当我尝试使用

npm i --save styled-components

时获取此错误:

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/styled-components failed, reason: connect ETIMEDOUT 2606:4700::6810:1123: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:
npm ERR!     C:\Users\nicho\AppData\Local\npm-cache\_logs\2022-05-05T23_33_02_048Z-debug-0.log

我不使用代理,其他所有内容都可以在我的网络中正常工作。

Hi guys, I have am trying to get my environment set up. I have started a React project with

npx create-react-app PROJECTNAME

I am now looking into using Styled Components. However when I attempt to install it with npm using this command

npm i --save styled-components

I get this error:

npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/styled-components failed, reason: connect ETIMEDOUT 2606:4700::6810:1123: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:
npm ERR!     C:\Users\nicho\AppData\Local\npm-cache\_logs\2022-05-05T23_33_02_048Z-debug-0.log

I am not using a proxy and everything else is working fine with my network.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟沫凡尘 2025-02-02 14:51:30

使用以下终端命令:CD ProjectName转到React App目录

go to the react app directory by using these terminal command : cd PROJECTNAME

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文