Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 无法安装react本机社区/react本机netinfo_React Native_React Native Community Netinfo - Fatal编程技术网

React native 无法安装react本机社区/react本机netinfo

React native 无法安装react本机社区/react本机netinfo,react-native,react-native-community-netinfo,React Native,React Native Community Netinfo,我想删除警告:NetInfo已从react native core中提取 并将在将来的版本中删除。 现在可以从“@react native community/netinfo”安装和导入它 而不是“反应本机”。 看,但当我运行命令时,它不起作用 npm install --save @react-native-community/netinfo 由于包名称中的@,powershell将其视为变量 您可以通过使用cmd.exe或将包名放在引号中来修复此问题,如:npm install-save@

我想删除警告:NetInfo已从react native core中提取 并将在将来的版本中删除。 现在可以从“@react native community/netinfo”安装和导入它 而不是“反应本机”。 看,但当我运行命令时,它不起作用

npm install --save @react-native-community/netinfo

由于包名称中的@,powershell将其视为变量

您可以通过使用cmd.exe或将包名放在引号中来修复此问题,如:npm install-save@react native community/netinfo 之后 npm i@react native community/netinfo放在cmd中,其答案是正确的。我想补充更多

npm安装-save@react native community/netinfo 使用引号运行此命令。 cd android转到您的android项目目录 gradlew clean运行此命令来清理您的android项目 然后运行react native run android或npx react native run android或任何用于启动项目的命令。
我已使用Windows Power Shell运行此命令。它会出错。使用cmd后,它就可以工作了。