React native 无法安装react本机社区/react本机netinfo
我想删除警告:NetInfo已从react native core中提取 并将在将来的版本中删除。 现在可以从“@react native community/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@
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后,它就可以工作了。