**
npx create-react-app my-app
学react时,执行npx create-react-app my-app这个会出现以下错误:
**
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/npx failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org
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 config set registry https://registry.npm.taobao.org
然后再执行:
npx create-react-app my-app
稍等一会,当看到以下图片,那么就ok了!!!!!!