我试图使用以下命令创建一个:
npx react-native init但是,模板下载只会停止并显示以下消息:
× Downloading template
error Error: Command failed: npm install --save --save-exact react-native@latest
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno -4077
npm ERR! network read ECONNRESET
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'发布于 2022-09-24 23:02:17
如果您以前安装了一个全局react本机-cli包,请删除它,因为它可能导致意外的问题:
npm uninstall -g react-native-cli @react-native-community/cli然后
npx react-native init AwesomeProjecthttps://stackoverflow.com/questions/73841051
复制相似问题