简体   繁体   English

安装 create-react-app 时出现 error.network

[英]error network while installing create-react-app

i've tried many times when installing create react app but it always error connection, but my inte.net connection is really stable我在安装 create react app 时尝试了很多次,但总是错误连接,但我的 inte.net 连接非常稳定

npx create-react-app my-app

npm ERR! npm 错误! code ECONNRESET npm ERR!代码 ECONNRESET npm 错误! syscall read npm ERR!系统调用读取 npm 错误! errno ECONNRESET npm ERR!.network Invalid response body while trying to fetch https://registry.npmjs.org/@svgr%2fplugin-jsx : read ECONNRESET npm ERR..network This is a problem related to.network connectivity. errno ECONNRESET npm ERR!.network Invalid response body while trying to fetch https://registry.npmjs.org/@svgr%2fplugin-jsx : read ECONNRESET npm ERR..network 这是与.network 连接相关的问题。 npm ERR,.network In most cases you are behind a proxy or have bad.network settings. npm ERR,.network 在大多数情况下,您在代理后面或具有错误的.network 设置。 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. npm ERR:.network npm ERR!.network 如果您使用代理,请确保 npm ERR!.network 'proxy' 配置设置正确。 See: 'npm help config'请参阅:'npm 帮助配置'

I had the same issue this Error occurred because you are using proxy server to connect inte.net if so stopping using proxy will solve it but if you want to keep up with proxy follow this first clear cache我有同样的问题发生这个错误是因为你正在使用代理服务器连接 inte.net 如果停止使用代理将解决它但是如果你想跟上代理请遵循这个第一个清除缓存

npm cache clear --force

second:第二:

npm config set registry http://registry.npmjs.org/

third:第三:

npm install -g create-react-app

last:最后的:

create-react-app appName

Try this:尝试这个:

npm install -g yarn

yarn global add create-react-app

create-react-app my-app

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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